diff options
49 files changed, 1083 insertions, 334 deletions
diff --git a/LibertyComment.php b/LibertyComment.php index 45db3e7..d73bae6 100644 --- a/LibertyComment.php +++ b/LibertyComment.php @@ -3,7 +3,7 @@ * Management of Liberty Content * * @author spider <spider@steelsun.com> - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ * @package Liberty */ @@ -203,20 +203,50 @@ class LibertyComment extends LibertyContent { WHERE tcm.`parent_id` = ?"; $rows = $this->GetAssoc($sql, array($contentId)); $commentCount += count($rows); -/* We do not want to count the children since they will be displayed on the page and it would mess up pagination - spiderr - I may be wrong, so I'll leave the complete code in for now foreach ($rows as $row) { if( !empty( $row['child_content_id'] ) ) { $commentCount += $this->getNumComments( $row['child_content_id'] ); } } -*/ } return $commentCount; } + + //input is a set of nested hashes + //output is a single flat hash of comments in thread order + function flatten_threads($threaded_comments = NULL) { + $flat_comments = array(); + foreach ($threaded_comments as $threaded_comment) { + $flat_comments[] = $threaded_comment; + if (!empty($threaded_comment['children'])) { + $children = $this->flatten_threads($threaded_comment['children']); + foreach ($children as $child) { + array_push($flat_comments, $child ); + } + } + } + return $flat_comments; + } + // Returns a hash containing the comment tree of comments related to this content - function getComments( $pContentId = NULL, $pMaxComments = NULL, $pOffset = NULL ) { + function getComments( $pContentId = NULL, $pMaxComments = NULL, $pOffset = NULL, $pSortOrder = NULL, $pDisplayMode = NULL ) { + if( $pDisplayMode == "flat" ) { + return $this->getComments_flat ($pContentId, $pMaxComments, $pOffset, $pSortOrder); + } else { + #return $this->getComments_threaded ($pContentId, $pMaxComments, $pOffset, $pSortOrder); + //use flat mode retreival so we get exactly the number of messages requested. + if ($pSortOrder == "commentDate_asc") { + return $this->getComments_flat ($pContentId, $pMaxComments, $pOffset, 'thread_asc'); + } else { + //descending thread order is not currently supported correctly, but we make an attempt anyway + return $this->getComments_flat ($pContentId, $pMaxComments, $pOffset, 'thread_desc'); + } + } + } + + // returns a set of nested hashes + function getComments_threaded( $pContentId = NULL, $pMaxComments = NULL, $pOffset = NULL, $pSortOrder = NULL ) { static $curLevel = 0; $contentId = NULL; @@ -226,16 +256,27 @@ class LibertyComment extends LibertyContent { } elseif ($pContentId) { $contentId = $pContentId; } + + + $sort_order = "ASC"; + if (!empty($pSortOrder)) { + if ($pSortOrder == 'commentDate_desc') { + $sort_order = 'DESC'; + } elseif ($pSortOrder == 'commentDate_asc') { + $sort_order = 'ASC'; + } + } + if ($contentId) { $sql = "SELECT tcm.`comment_id` FROM `".BIT_DB_PREFIX."tiki_comments` tcm, `".BIT_DB_PREFIX."tiki_content` tc - WHERE tcm.`parent_id` = ? AND tcm.`content_id` = tc.`content_id` ORDER BY tc.`created`"; + WHERE tcm.`parent_id` = ? AND tcm.`content_id` = tc.`content_id` ORDER BY tc.`created` $sort_order"; if( $rs = $this->query( $sql, array($contentId), $pMaxComments, $pOffset ) ) { $rows = $rs->getRows(); foreach ($rows as $row) { $comment = new LibertyComment($row['comment_id']); $comment->mInfo['level'] = $curLevel; $curLevel++; - $comment->mInfo['children'] = $this->getComments($comment->mInfo['content_id']); + $comment->mInfo['children'] = $this->getComments_threaded($comment->mInfo['content_id']); $comment->mInfo['parsed_data'] = $this->parseData($comment->mInfo['data'], $comment->mInfo['format_guid']); $curLevel--; $ret[] = $comment->mInfo; @@ -245,6 +286,80 @@ class LibertyComment extends LibertyContent { return $ret; } + + // Returns a hash containing the comment tree of comments related to this content + function getComments_flat( $pContentId = NULL, $pMaxComments = NULL, $pOffset = NULL, $pSortOrder = NULL ) { + static $curLevel = 0; + + $contentId = NULL; + $ret = array(); + if (!$pContentId && $this->mContentId) { + $contentId = $this->mContentId; + } elseif ($pContentId) { + $contentId = $pContentId; + } + + $sort_order = "ASC"; + if (!empty($pSortOrder)) { + if ($pSortOrder == 'commentDate_desc') { + $sort_order = 'DESC'; + } + if ($pSortOrder == 'commentDate_asc') { + $sort_order = 'ASC'; + } + if ($pSortOrder == 'thread_asc') { + $sort_order = 'TASC'; + } + // thread newest first is harder... + if ($pSortOrder == 'thread_desc') { + $sort_order = 'TDESC'; + } + } + + if ($contentId) { + + if ($sort_order == 'TDESC') { + + $threaded_comments = $this->getComments_threaded($pContentId, 999999, 0, 'commentDate_desc'); + } + else { + $threaded_comments = $this->getComments_threaded($pContentId, 999999, 0); + } + + # DB not structured to make FLAT easy + # have to retreive entire threaded comment set and then date sort in memory + # then take the chunk of N comments wanted. + + # now flatten into a linear array + $flat_comments = $this->flatten_threads($threaded_comments); + + # now sort by date + $last_modified = array(); + foreach ($flat_comments as $key => $comment) { + if (!empty( $comment['last_modified'])) { + $last_modified[$key] = $comment['last_modified']; + } + $comment['children'] = array(); + } + + if ($sort_order == 'ASC') { + array_multisort($last_modified, SORT_ASC, $flat_comments); + } + elseif ($sort_order == 'DESC') { + array_multisort($last_modified, SORT_DESC, $flat_comments); + } + // else default order + + # now select comments wanted + $ret = array_slice($flat_comments,$pOffset,$pMaxComments); + + } + + return $ret; + } + + + // Basic formatting for quoting comments function quoteComment($commentData) { $ret = '> '.$commentData; diff --git a/LibertyStructure.php b/LibertyStructure.php index 4690b14..9b9bc51 100755 --- a/LibertyStructure.php +++ b/LibertyStructure.php @@ -3,7 +3,7 @@ * Management of Liberty Content * * @author spider <spider@steelsun.com> - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty */ @@ -16,7 +16,7 @@ require_once( LIBERTY_PKG_PATH.'LibertyBase.php' ); * System class for handling the liberty package * * @author spider <spider@steelsun.com> -* @version $Revision: 1.2 $ +* @version $Revision: 1.3 $ * @package Liberty * @subpackage LibertyStructure */ @@ -140,6 +140,7 @@ class LibertyStructure extends LibertyBase { $struct_info = $this->getNode( $pStructureId ); $aux["first"] = true; $aux["last"] = true; + $aux["level"] = $level; $aux["pos"] = ''; $aux["structure_id"] = $struct_info["structure_id"]; $aux["title"] = $struct_info["title"]; @@ -161,6 +162,7 @@ class LibertyStructure extends LibertyBase { $aux = $res; $aux["first"] = ($pos == 1); $aux["last"] = false; + $aux["level"] = $level; if (strlen($parent_pos) == 0) { $aux["pos"] = "$pos"; } @@ -289,7 +291,7 @@ class LibertyStructure extends LibertyBase { $this->mDb->CompleteTrans(); $ret = $pParamHash['structure_id']; } else { -//vd( $this->mErrors ); + //vd( $this->mErrors ); } return $ret; } diff --git a/admin/admin_liberty_inc.php b/admin/admin_liberty_inc.php index 827b1f5..623852f 100644 --- a/admin/admin_liberty_inc.php +++ b/admin/admin_liberty_inc.php @@ -9,20 +9,31 @@ $formLibertyFeatures = array( 'label' => 'Auto-Display Attachment Thumbnails', 'note' => 'This will automatically display thumbnails of all attachments of a given page (usually in the top right corner of the page). You can still display the items inline as well.', 'page' => '', - ) + ), ); -if( $gBitSystem->isPackageActive( 'tinymce' ) ) { - $formLibertyFeatures["tinymce_ask"] = array( - 'label' => 'WYSIWYG confirmation', - 'note' => 'Ask before using the WYSIWYG editor tinymce when clicking on a textarea. If you disable this feature, we strongly suggest you enable HTML content format as the only content format and also disable quicktags.', + +$smarty->assign( 'formLibertyFeatures', $formLibertyFeatures ); + +$formCommentFeatures = array( + "comments_reorganise_page_layout" => array( + 'label' => 'Position Comments at top of page', + 'note' => 'When posting a comment, comments are moved to the top of the page. This can be very disorienting and is only recommended when your site uses comments extensively.', 'page' => '', - ); -} -$smarty->assign('formLibertyFeatures', $formLibertyFeatures); -//vd($_REQUEST); -if (!empty($_REQUEST['change_prefs'])) { + ), + "comments_display_option_bar" => array( + 'label' => 'Display Comments option bar', + 'note' => 'Display an option bar above comments to specify how they should be sorted and how they should be displayed. Useful if your site uses comments extensively.', + 'page' => '', + ), +); +$smarty->assign( 'formCommentFeatures', $formCommentFeatures ); + +$formValues = array( 'image_processor', 'liberty_attachment_link_format', 'comments_per_page', 'comments_default_ordering', 'comments_default_display_mode' ); + +if( !empty( $_REQUEST['change_prefs'] ) ) { $errors = array(); - foreach( $formLibertyFeatures as $item => $data ) { + $formFeatures = array_merge( $formLibertyFeatures, $formCommentFeatures ); + foreach( $formFeatures as $item => $data ) { simple_set_toggle( $item ); } @@ -34,16 +45,16 @@ if (!empty($_REQUEST['change_prefs'])) { $tags = substr( $tags, 0, $lastAngle ); $errors['warning'] = 'The approved tags list has been shortened. You can only have 250 characters for approved tags.'; } - $gBitSystem->storePreference('approved_html_tags', $tags , LIBERTY_PKG_NAME ); } $smarty->assign_by_ref( 'errors', $errors ); - $gBitSystem->storePreference('image_processor', (!empty( $_REQUEST['image_processor'] ) ? $_REQUEST['image_processor'] : NULL ) , LIBERTY_PKG_NAME ); - $gBitSystem->storePreference('liberty_attachment_link_format', ( !empty( $_REQUEST['liberty_auto_display_attachment_thumbs'] ) ? $_REQUEST['liberty_auto_display_attachment_thumbs'] : NULL ), LIBERTY_PKG_NAME ); + foreach( $formValues as $item ) { + simple_set_value( $item ); + } } $tags = $gBitSystem->getPreference( 'approved_html_tags', DEFAULT_ACCEPTABLE_TAGS ); -$smarty->assign('approved_html_tags', $tags ); +$smarty->assign( 'approved_html_tags', $tags ); ?> diff --git a/admin/plugins.php b/admin/plugins.php index 045e932..ca3414c 100644 --- a/admin/plugins.php +++ b/admin/plugins.php @@ -15,12 +15,14 @@ if( isset( $_REQUEST['pluginsave'] ) && !empty( $_REQUEST['pluginsave'] ) ) { // Sort the plugins to avoild splitting tables foreach( $gLibertySystem->mPlugins as $key => $row ) { + $types[ucfirst( $row['plugin_type'] )] = $row['plugin_type']; $type[$key] = $row['plugin_type']; $guid[$key] = $row['plugin_guid']; } array_multisort( $type, SORT_ASC, $guid, SORT_ASC, $gLibertySystem->mPlugins ); - $smarty->assign_by_ref( 'gLibertySystem', $gLibertySystem ); +ksort( $types ); +$smarty->assign_by_ref( 'pluginTypes', $types ); //vd( $gLibertySystem->mPlugins ); diff --git a/comments_inc.php b/comments_inc.php index 3d5ebc5..b73cad7 100644 --- a/comments_inc.php +++ b/comments_inc.php @@ -3,12 +3,12 @@ * comment_inc * * @author spider <spider@steelsun.com> - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage functions */ -// $Header: /cvsroot/bitweaver/_bit_liberty/comments_inc.php,v 1.2 2005/06/28 07:45:47 spiderr Exp $ +// $Header: /cvsroot/bitweaver/_bit_liberty/comments_inc.php,v 1.3 2005/07/17 17:36:08 squareing Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. @@ -102,18 +102,40 @@ if (!empty($_REQUEST['post_comment_reply_id'])) { $smarty->assign('post_comment_reply_id', $post_comment_reply_id); } +$maxComments = $gBitSystem->getPreference( 'comments_per_page', 10 ); +if (!empty($_REQUEST["comments_maxComments"])) { + $maxComments = $_REQUEST["comments_maxComments"]; + $comments_at_top_of_page = 'y'; +} + +$comments_sort_mode = $gBitSystem->getPreference( 'comments_default_ordering', 'commentDate_desc' ); +if (!empty($_REQUEST["comments_sort_mode"])) { + $comments_sort_mode = $_REQUEST["comments_sort_mode"]; + $comments_at_top_of_page = 'y'; +} + +$comments_display_style = $gBitSystem->getPreference( 'comments_default_display_mode', 'threaded' ); +if( !empty( $_REQUEST["comments_style"] ) ) { + $comments_display_style = $_REQUEST["comments_style"]; + $comments_at_top_of_page = 'y'; +} + +if( !empty( $_REQUEST['comment_page'] ) || !empty( $_REQUEST['post_comment_request'] ) ) { + $comments_at_top_of_page = 'y'; +} $commentOffset = !empty( $_REQUEST['comment_page'] ) ? ($_REQUEST['comment_page'] - 1) * $maxComments : 0; $gComment = new LibertyComment( NULL, $gContent->mContentId ); // $commentsParentId is the content_id which the comment tree is attached to -if (empty($commentsParentId)) { +if( empty( $commentsParentId ) ) { $comments = NULL; $numComments = 0; } else { - $comments = $gComment->getComments($commentsParentId, $maxComments, $commentOffset ); - $numComments = $gComment->getNumComments($commentsParentId); + $comments = $gComment->getComments( $commentsParentId, $maxComments, $commentOffset, $comments_sort_mode, $comments_display_style ); + $numComments = $gComment->getNumComments( $commentsParentId ); } $smarty->assign('comments', $comments); +$smarty->assign('maxComments', $maxComments); $numCommentPages = ceil( $numComments / $maxComments ); $currentPage = !empty( $_REQUEST['comment_page'] ) ? $_REQUEST['comment_page'] : 1; @@ -123,10 +145,17 @@ $commentsPgnHash = array( 'pgnName' => 'comment_page', 'page' => $currentPage, 'url' => $comments_return_url, + 'maxComments' => $maxComments, + 'comments_sort_mode' => $comments_sort_mode, + 'comments_style' => $comments_display_style, + 'ianchor' => 'editcomments', ); $smarty->assign( 'commentsPgnHash', $commentsPgnHash ); $smarty->assign('postComment', $postComment); $smarty->assign('currentTimestamp', time()); $smarty->assign('comments_return_url', $comments_return_url); +$smarty->assign('comments_at_top_of_page', ( isset( $comments_at_top_of_page ) && $gBitSystem->getPreference( 'comments_reorganise_page_layout', 'n' ) == 'y' ) ? $comments_at_top_of_page : NULL ); +$smarty->assign('comments_style', $comments_display_style); +$smarty->assign('comments_sort_mode', $comments_sort_mode); ?> diff --git a/edit_structure_inc.php b/edit_structure_inc.php index 39b72d3..3288d23 100644 --- a/edit_structure_inc.php +++ b/edit_structure_inc.php @@ -2,8 +2,8 @@ /** * edit_structure_inc * - * @author Christian Fowler> - * @version $Revision: 1.2 $ + * @author Christian Fowler + * @version $Revision: 1.3 $ * @package Liberty * @subpackage functions */ @@ -140,7 +140,7 @@ if( empty( $gContent ) ) { } $smarty->assign( (!empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : 'body').'TabSelect', 'tdefault' ); - $smarty->assign('subtree', $rootStructure->getSubTree( $rootStructure->mStructureId )); + $smarty->assign('subtree', $rootTree = $rootStructure->getSubTree( $rootStructure->mStructureId )); } diff --git a/icons/spy.gif b/icons/spy.gif Binary files differnew file mode 100644 index 0000000..dc18436 --- /dev/null +++ b/icons/spy.gif diff --git a/list_content.php b/list_content.php index 7895147..52ade1d 100644 --- a/list_content.php +++ b/list_content.php @@ -3,7 +3,7 @@ * list_content * * @author spider <spider@steelsun.com> - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage functions */ @@ -22,7 +22,7 @@ if( !empty( $_REQUEST['sort_mode'] ) ) { $max_content = $gBitSystem->mPrefs['maxRecords']; $offset_content = !empty( $_REQUEST['offset'] ) ? $_REQUEST['offset'] : 0; $smarty->assign( 'user_id', !empty( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : NULL ); -$smarty->assign( 'page', $page = !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : 1 ); +$smarty->assign( 'curPage', $page = !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : 1 ); $offset_content = ( $page - 1 ) * $gBitSystem->mPrefs['maxRecords']; // now that we have all the offsets, we can get the content list diff --git a/plugins/data.addtabs.php b/plugins/data.addtabs.php index 0a64b74..5adccd6 100644 --- a/plugins/data.addtabs.php +++ b/plugins/data.addtabs.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -15,7 +15,7 @@ // +----------------------------------------------------------------------+ // | Author: StarRider <starrrider@users.sourceforge.net> // +----------------------------------------------------------------------+ -// $Id: data.addtabs.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.addtabs.php,v 1.3 2005/07/17 17:36:09 squareing Exp $ /** * definitions @@ -31,7 +31,7 @@ $pluginParams = array ( 'tag' => 'ADDTABS', 'help_page' => 'DataPluginAddTabs', 'description' => tra("Will join the contents from several sources in a Tabbed Interface."), 'help_function' => 'data_addtabs_help', - 'syntax' => "{addtabs tab1= tab2= tab3= . . . tab99= }", + 'syntax' => "{ADDTABS tab1= tab2= tab3= . . . tab99= }", 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAADDTABS, $pluginParams ); @@ -57,24 +57,23 @@ function data_addtabs_help() { . tra("<br /><strong>Note 2:</strong> The order used when the tabs are specified does not matter. The Tabname does - Tab1 is always first and Tab99 will always be last.</td>") .'</tr>' .'</table>' - . tra("Example: ") . '{addtabs tab1=15 tab2=12 tab3=11}'; + . tra("Example: ") . '{ADDTABS tab1=15 tab2=12 tab3=11}'; return $help; } function data_addtabs($data, $params) { extract ($params); - $ret = "<div id='tab-system' class='tabsystem'>"; + $ret = '<div class="tabpane">'; for ($i = 1; $i <= 99; $i++) { if( isset( ${'tab'.$i} ) && is_numeric( ${'tab'.$i} ) ) { $obj = LibertyBase::getLibertyObject( ${'tab'.$i} ); if( $obj->load() ) { - $ret .= "<div class='tabpage '><h3>" .$obj->getTitle() . "</h3><div class='contents'>" . $obj->parseData() . "</div></div><!-- end .tabpage -->"; -// $ret .= "<div class='tabpage '><h3>" . ${'tab'.$i} . "</h3><div class='contents'>" . $obj->parseData() . "</div></div><!-- end .tabpage -->"; + $ret .= '<div class="tabpage"><h4 class="tab">'.$obj->getTitle().'</h4>'.$obj->parseData().'</div>'; $good=True; } } } - $ret .= "</div>"; + $ret .= "</div><script type=\"text/javascript\">//<![CDATA[\nsetupAllTabs();\n//]]></script>"; if( !$good ) { $ret = "The Plugin AddTabs requires valid parameters. Numeric content id numbers can use the parameter names 'tab1' thru 'tab99'"; } diff --git a/plugins/data.agentinfo.php b/plugins/data.agentinfo.php index 13beb2c..36a01ee 100644 --- a/plugins/data.agentinfo.php +++ b/plugins/data.agentinfo.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -17,7 +17,7 @@ // | Reworked for Bitweaver (& Undoubtedly Screwed-Up) // | by: StarRider <starrrider@users.sourceforge.net> // +----------------------------------------------------------------------+ -// $Id: data.agentinfo.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.agentinfo.php,v 1.3 2005/07/17 17:36:09 squareing Exp $ /** * definitions @@ -32,7 +32,7 @@ $pluginParams = array ( 'tag' => 'AGENTINFO', 'help_page' => 'DataPluginAgentInfo', 'description' => tra("This plugin will display the viewer's IP address, the Browser they are using, or the info about the site's Server software."), 'help_function' => 'data_agentinfo_help', - 'syntax' => "{agentinfo info= }", + 'syntax' => "{AGENTINFO info= }", 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAAGENTINFO, $pluginParams ); @@ -58,7 +58,7 @@ function data_agentinfo_help() { .'<strong>server</strong>: ' . tra( "To get the site\'s server software" ) . '<br />' .'</tr>' .'</table>' - . tra("Example: ") . "{agentinfo info='browser'}"; + . tra("Example: ") . "{AGENTINFO info='browser'}"; return $help; } diff --git a/plugins/data.article.php b/plugins/data.article.php index 8d8aa07..14608d7 100644 --- a/plugins/data.article.php +++ b/plugins/data.article.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -18,7 +18,7 @@ // | by: StarRider <starrrider@users.sourceforge.net> // | Reworked from: wikiplugin_article.php - see deprecated code below // +----------------------------------------------------------------------+ -// $Id: data.article.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.article.php,v 1.3 2005/07/17 17:36:09 squareing Exp $ /** * definitions @@ -36,7 +36,7 @@ $pluginParams = array ( 'tag' => 'ARTICLE', 'help_page' => 'DataPluginArticle', 'description' => tra("This plugin will display the data from a single field in the specified Article."), 'help_function' => 'data_article_help', - 'syntax' => "{article id= field=}", + 'syntax' => "{ARTICLE id= field=}", 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAARTICLE, $pluginParams ); @@ -63,7 +63,7 @@ function data_article_help() { . tra("This includes (in order of usefulnes):") . '<strong>title, heading, body, author, size, reads, votes, points, type and rating</strong>' . '</td>' .'</tr>' .'</table>' - . tra("Example: ") . "{article id=14 field='heading'}"; + . tra("Example: ") . "{ARTICLE id=14 field='heading'}"; return $help; } diff --git a/plugins/data.articles.php b/plugins/data.articles.php index f0bb224..2e3a9b3 100644 --- a/plugins/data.articles.php +++ b/plugins/data.articles.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -18,7 +18,7 @@ // | by: StarRider <starrrider@users.sourceforge.net> // | Reworked from: wikiplugin_articles.php - see deprecated code below // +----------------------------------------------------------------------+ -// $Id: data.articles.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.articles.php,v 1.3 2005/07/17 17:36:09 squareing Exp $ /** * definitions @@ -36,7 +36,7 @@ $pluginParams = array ( 'tag' => 'ARTICLES', 'help_page' => 'DataPluginArticles', 'description' => tra("This plugin will display several Articles."), 'help_function' => 'data_articles_help', - 'syntax' => "{articles max= topic= type= }", + 'syntax' => "{ARTICLES max= topic= type= }", 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAARTICLES, $pluginParams ); @@ -67,8 +67,8 @@ function data_articles_help() { .'<td>' . tra( "Filters the Articles so that only the Type specified is displayed") . '</td>' .'</tr>' .'</table>' - . tra("Example: ") . "{articles max=5 topic='some_topic'}<br />" - . tra("Example: ") . "{articles max=5 type='some_type'}"; + . tra("Example: ") . "{ARTICLES max=5 topic='some_topic'}<br />" + . tra("Example: ") . "{ARTICLES max=5 type='some_type'}"; return $help; } diff --git a/plugins/data.attachment.php b/plugins/data.attachment.php index aa3cfd4..aef47a5 100644 --- a/plugins/data.attachment.php +++ b/plugins/data.attachment.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -15,7 +15,7 @@ // +----------------------------------------------------------------------+ // | Authors: drewslater <andrew@andrewslater.com> // +----------------------------------------------------------------------+ -// $Id: data.attachment.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.attachment.php,v 1.3 2005/07/17 17:36:09 squareing Exp $ /** * definitions @@ -32,7 +32,7 @@ $pluginParams = array ( 'tag' => 'ATTACHMENT', 'help_page' => 'DataPluginAttachment', 'description' => tra("Display attachment in content"), 'help_function' => 'data_attachment_help', - 'syntax' => '{attachment id= size= align= }', + 'syntax' => '{ATTACHMENT id= size= align= }', 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAATTACHMENT, $pluginParams ); @@ -77,7 +77,7 @@ function data_attachment_help() { . tra("(Default = ") . '<strong>'.tra( 'none - attachment is shown inline' ).'</strong>)</td>' .'</tr>' .'</table>' - . tra("Example: ") . "{attachment id='13' size='small' align='center' link='http://www.google.com'}"; + . tra("Example: ") . "{ATTACHMENT id='13' size='small' align='center' link='http://www.google.com'}"; return $help; } diff --git a/plugins/data.avatar.php b/plugins/data.avatar.php index deb8757..d6fa424 100644 --- a/plugins/data.avatar.php +++ b/plugins/data.avatar.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -18,7 +18,7 @@ // | by: StarRider <starrrider@users.sourceforge.net> // | Reworked from: wikiplugin_avatar.php - see deprecated code below // +----------------------------------------------------------------------+ -// $Id: data.avatar.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.avatar.php,v 1.3 2005/07/17 17:36:09 squareing Exp $ /** * definitions @@ -36,7 +36,7 @@ $pluginParams = array ( 'tag' => 'AVATAR', 'help_page' => 'DataPluginAvatar', 'description' => tra("This plugin will display a User's Avatar as a Link to a page."), 'help_function' => 'data_avatar_help', - 'syntax' => "{avatar user= page= float= }", + 'syntax' => "{AVATAR user= page= float= }", 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAAVATAR, $pluginParams ); @@ -69,7 +69,7 @@ function data_avatar_help() { . ' <strong>left or right</strong> ' . tra("(Default = ") . '<strong>NOT SET</strong>)</td>' .'</tr>' .'</table>' - . tra("Example: ") . "{include user='admin' page='home' float='right'}"; + . tra("Example: ") . "{AVATAR user='admin' page='home' float='right'}"; return $help; } diff --git a/plugins/data.backlinks.php b/plugins/data.backlinks.php index e058b34..b67cbf2 100644 --- a/plugins/data.backlinks.php +++ b/plugins/data.backlinks.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -18,7 +18,7 @@ // | by: StarRider <starrrider@users.sourceforge.net> // | Reworked from: wikiplugin_backlinks.php - see deprecated code below // +----------------------------------------------------------------------+ -// $Id: data.backlinks.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.backlinks.php,v 1.3 2005/07/17 17:36:09 squareing Exp $ /** * definitions @@ -36,7 +36,7 @@ $pluginParams = array ( 'tag' => 'BACKLINKS', 'help_page' => 'DataPluginBackLinks', 'description' => tra("This plugin will list all Wiki pages which contains a link to the specified page."), 'help_function' => 'data_backlinks_help', - 'syntax' => "{backlinks page= info= exclude= self= header= }", + 'syntax' => "{BACKLINKS page= info= exclude= self= header= }", 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATABACKLINKS, $pluginParams ); @@ -79,8 +79,8 @@ function data_backlinks_help() { .'<td>' . tra( "Causes a heading to be displayed above the list. Any value results in TRUE. (Default = FALSE)") . '</td>' .'</tr>' .'</table>' - . tra("Example: ") . "{backlinks page='MyHomePage' info='hits|user' exclude='HomePage|SandBox'}<br />" - . tra("Example: ") . "{backlinks page='MyHomePage' info='hits|user' exclude='HomePage|SandBox' self='Yes' header='Yes'}"; + . tra("Example: ") . "{BACKLINKS page='MyHomePage' info='hits|user' exclude='HomePage|SandBox'}<br />" + . tra("Example: ") . "{BACKLINKS page='MyHomePage' info='hits|user' exclude='HomePage|SandBox' self='Yes' header='Yes'}"; return $help; } diff --git a/plugins/data.category.php b/plugins/data.category.php index 0ea8c33..3b87e07 100644 --- a/plugins/data.category.php +++ b/plugins/data.category.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -18,7 +18,7 @@ // | by: StarRider <starrrider@users.sourceforge.net> // | Reworked from: wikiplugin_category.php - see deprecated code below // +----------------------------------------------------------------------+ -// $Id: data.category.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.category.php,v 1.3 2005/07/17 17:36:09 squareing Exp $ /** * definitions @@ -36,7 +36,7 @@ $pluginParams = array ( 'tag' => 'CATEGORY', 'help_page' => 'DataPluginCategory', 'description' => tra("This plugin insert a list of items for the current category or a given category."), 'help_function' => 'data_category_help', - 'syntax' => "{category id= types= sort= sub= split= }", + 'syntax' => "{CATEGORY id= types= sort= sub= split= }", 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATACATEGORY, $pluginParams ); diff --git a/plugins/data.catorphans.php b/plugins/data.catorphans.php index a422610..b5db969 100644 --- a/plugins/data.catorphans.php +++ b/plugins/data.catorphans.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -18,7 +18,7 @@ // | by: StarRider <starrrider@users.sourceforge.net> // | Reworked from: wikiplugin_catorphans.php - see deprecated code below // +----------------------------------------------------------------------+ -// $Id: data.catorphans.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.catorphans.php,v 1.3 2005/07/17 17:36:09 squareing Exp $ /** * definitions @@ -36,7 +36,7 @@ $pluginParams = array ( 'tag' => 'CATORPHANS', 'help_page' => 'DataPluginCatOrphans', 'description' => tra("Creates a listing of bitweaver objects that have not been categorized."), 'help_function' => 'data_catorphans_help', - 'syntax' => "{catorphans objects= }", + 'syntax' => "{CATORPHANS objects= }", 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATACATORPHANS, $pluginParams ); @@ -57,7 +57,7 @@ function data_catorphans_help() { .'<td>' . tra("Most bitweaver Objects can be selected, including") . " <strong>article, blog, faq, fgal, igal, newsletter, poll, quiz, survey, tracker, & wiki</strong>. " . tra("Multiple objects can be entered bu using the character + between object names, like this") . " <strong>blog+faq</strong>. " . tra(". The default is <strong>wiki</strong> objects.") . '</td>' .'</tr>' .'</table>' - . tra("Example: ") . "{catorphans objects='wiki+blog+faq'}"; + . tra("Example: ") . "{CATORPHANS objects='wiki+blog+faq'}"; return $help; } diff --git a/plugins/data.catpath.php b/plugins/data.catpath.php index f82cd80..b860957 100644 --- a/plugins/data.catpath.php +++ b/plugins/data.catpath.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -18,7 +18,7 @@ // | by: StarRider <starrrider@users.sourceforge.net> // | Reworked from: wikiplugin_catpath.php - see deprecated code below // +----------------------------------------------------------------------+ -// $Id: data.catpath.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.catpath.php,v 1.3 2005/07/17 17:36:09 squareing Exp $ /** * definitions @@ -62,7 +62,7 @@ function data_catpath_help() { .'<td>' . tra( "Determins if the TOP category is displayed or not. Passing any value in this parameter will make it <strong>TRUE</strong>. The Default = <strong>FALSE</strong> so the TOP category will not be displayed") . '</td>' .'</tr>' .'</table>' - . tra("Example: ") . "{catpath divider='->' top='yes' }"; + . tra("Example: ") . "{CATPATH divider='->' top='yes' }"; return $help; } diff --git a/plugins/data.code.php b/plugins/data.code.php index 85d04d7..f825dc7 100644 --- a/plugins/data.code.php +++ b/plugins/data.code.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -17,7 +17,7 @@ // | Reworked for Bitweaver (& Undoubtedly Screwed-Up) // | by: StarRider <starrrider@users.sourceforge.net> // +----------------------------------------------------------------------+ -// $Id: data.code.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.code.php,v 1.3 2005/07/17 17:36:09 squareing Exp $ /** * definitions @@ -32,7 +32,7 @@ $pluginParams = array ( 'tag' => 'CODE', 'help_page' => 'DataPluginCode', 'description' => tra("Displays the Source Code Snippet between {Code} blocks."), 'help_function' => 'data_code_help', - 'syntax' => " {code source= num= }". tra("Sorce Code Snippet") . "{code}", + 'syntax' => " {CODE source= num= }". tra("Sorce Code Snippet") . "{code}", 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATACODE, $pluginParams ); @@ -59,7 +59,7 @@ function data_code_help() { .'<td>' . tra( "Determins if line numbers are displayed. Passing") . ' <strong>TRUE, ON, or YES</strong> ' . tra("in this parameter will make it") . ' <strong>TRUE</strong>. ' . tra("Any ohter value will make it") . ' <strong>FALSE</strong>' . tra("The Default =") . ' <strong>FALSE</strong> ' . tra("so Line Numbers are not displayed.") . '</td>' .'</tr>' .'</table>' - . tra("Example: ") . "{code source='php' num='on' }" . tra("Sorce Code Snippet") . "{code}"; + . tra("Example: ") . "{CODE source='php' num='on' }" . tra("Sorce Code Snippet") . "{code}"; return $help; } diff --git a/plugins/data.comment.php b/plugins/data.comment.php index fd0cac0..91a2c8d 100644 --- a/plugins/data.comment.php +++ b/plugins/data.comment.php @@ -1,7 +1,9 @@ <?php +// $Id: data.comment.php,v 1.3 2005/07/17 17:36:09 squareing Exp $ /** - * @version $Revision: 1.2 $ - * @package Liberty + * @author StarRider <starrrider@sourceforge.net> + * @version $Revision: 1.3 $ + * @package liberty * @subpackage plugins_data */ // +----------------------------------------------------------------------+ @@ -16,11 +18,14 @@ // | Author: StarRider <starrrider@sourceforge.net> // | Wrote it but didn't think of it :-) // +----------------------------------------------------------------------+ -// $Id: data.comment.php,v 1.2 2005/06/29 05:43:38 spiderr Exp $ +// $Id: data.comment.php,v 1.3 2005/07/17 17:36:09 squareing Exp $ /** * definitions */ +/****************** + * Initialization * + ******************/ define( 'PLUGIN_GUID_COMMENT', 'comment' ); global $gLibertySystem; $pluginParams = array ( 'tag' => 'COMMENT', @@ -29,15 +34,16 @@ $pluginParams = array ( 'tag' => 'COMMENT', 'load_function' => 'data_comment', 'title' => 'Comment', 'help_page' => 'DataPluginComment', - 'description' => tra("This plugin allows comments (Text that is not displayed) to be stored."), + 'description' => tra("This plugin allows Comments (Text that will not be displayed) to be added to a page."), 'help_function' => 'data__comment_help', - 'syntax' => "{COMMENT}", + 'syntax' => "{COMMENT}Data Not Displayed{COMMENT}", 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_COMMENT, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_COMMENT ); - -// Help Function +/***************** + * Help Function * + *****************/ function data_comment_help() { $help = '<table class="data help">' @@ -47,15 +53,16 @@ function data_comment_help() { .'<th>' . tra( "Comments" ) . '</th>' .'</tr>' .'<tr class="odd">' - .'<td>' . tra("This plugin uses no parameters. All data located between the") . ' <strong>{COMMENT}</strong> ' - .tra("is simply not displayed.") . '</td>' + .'<td>' . tra("This plugin uses no parameters. Anything located between the two") + . ' <strong>{COMMENT}</strong> ' . tra("Blocks is not displayed.") . '</td>' .'</tr>' .'</table>' - . tra("Example: ") . "{COMMENT}" . tra("Anything a user wants included but not displayed.") . "{COMMENT}"; + . tra("Example: ") . "{COMMENT}" . tra("Everything in here is not displayed.") . "{COMMENT}"; return $help; } - -// Load Function +/**************** +* Load Function * + ****************/ function data_comment($data, $params) { return ' '; } diff --git a/plugins/data.countdown.php b/plugins/data.countdown.php index 4c41f1d..8aa5b26 100644 --- a/plugins/data.countdown.php +++ b/plugins/data.countdown.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -17,7 +17,7 @@ // | Reworked for Bitweaver (& Undoubtedly Screwed-Up) // | by: StarRider <starrrider@users.sourceforge.net> // +----------------------------------------------------------------------+ -// $Id: data.countdown.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.countdown.php,v 1.3 2005/07/17 17:36:09 squareing Exp $ /** * definitions @@ -32,7 +32,7 @@ $pluginParams = array ( 'tag' => 'COUNTDOWN', 'help_page' => 'DataPluginCountDown', 'description' => tra("Displays a Count-Down until a date:time is reached - then - negative numbers indicate how long it has been since that date. The Count-Down is displayed in the format of (X days, X hours, X minutes and X seconds)."), 'help_function' => 'data_countdown_help', - 'syntax' => "{countdown enddate= localtime= }" . tra("Text") . "{countdown}", + 'syntax' => "{COUNTDOWN enddate= localtime= }" . tra("Text") . "{countdown}", 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATACOUNTDOWN, $pluginParams ); @@ -58,7 +58,7 @@ function data_countdown_help() { .'<td>' . tra( "Determins if Local Time is displayed or not. Passing any value in this parameter will make it <strong>TRUE</strong>. The Default = <strong>FALSE</strong> so Local Time will not be displayed") . '</td>' .'</tr>' .'</table>' - . tra("Example: ") . "{countdown enddate='8:02pm May 10 2004' localtime='on'}" . tra(" - Time Passes So Slowly") . "{countdown}<br />" + . tra("Example: ") . "{COUNTDOWN enddate='8:02pm May 10 2004' localtime='on'}" . tra(" - Time Passes So Slowly") . "{countdown}<br />" . tra("Displays: <strong>82 days, 23 hours, 37 minutes and 31 seconds - Time Passes So Slowly</strong>"); return $help; } diff --git a/plugins/data.dropdown.php b/plugins/data.dropdown.php new file mode 100644 index 0000000..94f0a7d --- /dev/null +++ b/plugins/data.dropdown.php @@ -0,0 +1,91 @@ +<?php +// $id: +/** + * assigned_modules + * + * @author StarRider <starrrider@sourceforge.net> + * @version $Revision: 1.2 $ + * @package liberty + * @subpackage plugins_data + * + * @copyright Copyright (c) 2004, bitweaver.org + * All Rights Reserved. See copyright.txt for details and a complete list of authors. + * @license Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. + */ + +/** + * Initialization + */ +global $gLibertySystem; +define( 'PLUGIN_GUID_DROPDOWN', 'dropdown' ); +$pluginParams = array ( 'tag' => 'DD', + 'auto_activate' => TRUE, + 'requires_pair' => TRUE, + 'load_function' => 'data_dropdown', + 'title' => 'DropDown (DD)', + 'help_page' => 'DataPluginDropDown', + 'description' => tra("This plugin creates a expandable box of text.. All text should be entered between the ") . "{DD} " . tra("blocks."), + 'help_function' => 'data_dropdown_help', + 'syntax' => "{DD title= width= }" . tra("Text in the Drop-Down box.") . "{DD}", + 'plugin_type' => DATA_PLUGIN + ); +$gLibertySystem->registerPlugin( PLUGIN_GUID_DROPDOWN, $pluginParams ); +$gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DROPDOWN ); + +/** + * Help Function + */ +function data_dropdown_help() { + $help = + '<table class="data help">' + .'<tr>' + .'<th>' . tra( "Key" ) . '</th>' + .'<th>' . tra( "Type" ) . '</th>' + .'<th>' . tra( "Comments" ) . '</th>' + .'</tr>' + .'<tr class="odd">' + .'<td>title</td>' + .'<td>' . tra( "string") . '<br />' . tra("(optional)") . '</td>' + .'<td>' . tra( 'String used as the link to Expand / Contract the text box. <br />The Default = <strong>"For More Information"</strong></td>') + .'</tr>' + .'<tr class="even">' + .'<td>width</td>' + .'<td>' . tra( "numeric") . '<br />' . tra("(optional)") . '</td>' + .'<td>' . tra( "Controls the width of the title area in pixels. This is a percentage value but the % character should not be added.<br />The Default = ") . '<strong>20</strong></td>' + .'</tr>' + .'</table>' + . tra("Example: ") . '{DD}' . tra("Text in the Drop-Down box.") . '{DD}<br />' + . tra("Example: ") . "{DD title='" . tra("Explaining the Lines #1 #3 & #7'} Text in the Drop-Down box") . '{DD}'; + return $help; +} + +/** + * Load Function + */ +function data_dropdown($data, $params) { + extract ($params); + $title = (isset($title)) ? $title : 'For More Information'; + $width = (isset($width)) ? $width : '20'; + $width = ((100 - $width) / 2) . '%'; + $dd = (microtime() * 1000000); + + $ret = + '<div>' + .'<table width="100%" border="0" cellspacing="0" cellpadding="0">' + .'<tr>' + .'<td width=' . $width . '><hr></td>' + .'<td>' + .'<div style="text-align:center">' + .'<a title="Click to Expand or Contract" href="javascript:flip(' . $dd . ')"><Strong>' . $title . '</strong></a>' + .'</div>' + .'</td>' + .'<td width=' . $width . '><hr></td>' + .'</tr>' + .'</table>' + .'</div>' + .'<div class="help box" style="display:none" id="' . $dd . '">' + .$data + .'</div>'; + return $ret; +} +?> diff --git a/plugins/data.freemind.php b/plugins/data.freemind.php index d03c718..f41e195 100644 --- a/plugins/data.freemind.php +++ b/plugins/data.freemind.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ * @package Liberty * @subpackage plugins_data */ @@ -27,7 +27,7 @@ $pluginParams = array ( 'tag' => 'MM', 'auto_activate' => TRUE, 'requires_pair' => FALSE, 'load_function' => 'data_freemind', - 'title' => 'FreeMind (MM)', + 'title' => 'FreeMind (Mind Map)', 'help_page' => 'DataPluginFreeMind', 'description' => tra("Displays a Freemind mindmap"), 'help_function' => 'data_freemind_help', diff --git a/plugins/data.include.php b/plugins/data.include.php index e0ca907..267fd33 100644 --- a/plugins/data.include.php +++ b/plugins/data.include.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ * @package Liberty * @subpackage plugins_data */ @@ -17,7 +17,7 @@ // | Reworked for Bitweaver (& Undoubtedly Screwed-Up) // | by: StarRider <starrrider@users.sourceforge.net> // +----------------------------------------------------------------------+ -// $Id: data.include.php,v 1.3 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.include.php,v 1.4 2005/07/17 17:36:10 squareing Exp $ /** * definitions @@ -64,9 +64,9 @@ function data_include_help() { Avaliable content can be viewed <a href="'.LIBERTY_PKG_URL.'list_content.php">here</a>' ).'</td> </tr> </table> - Example: {include page_name=15} - Example: {include page_id=15} - Example: {include content_id=15}'; + Example: {INCLUDE page_name=15} + Example: {INCLUDE page_id=15} + Example: {INCLUDE content_id=15}'; return $help; } diff --git a/plugins/data.maketoc.php b/plugins/data.maketoc.php index 1d07efe..527de65 100644 --- a/plugins/data.maketoc.php +++ b/plugins/data.maketoc.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -15,7 +15,7 @@ // +----------------------------------------------------------------------+ // | Author: xing <xing@synapse.plus.com> // +----------------------------------------------------------------------+ -// $Id: data.maketoc.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.maketoc.php,v 1.3 2005/07/17 17:36:10 squareing Exp $ /** * definitions @@ -32,7 +32,7 @@ $pluginParams = array ( 'tag' => 'MAKETOC', 'description' => tra("Will create a table of contents of the WikiPage based on the headings below."), 'help_function' => 'data_maketoc_help', - 'syntax' => "{maketoc}", + 'syntax' => "{MAKETOC}", 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAMAKETOC, $pluginParams ); @@ -63,7 +63,7 @@ function data_maketoc_help() { .'<td>' . tra( 'if you set backtotop <strong>' ).'true'.( '</strong>, it will insert a "back to the top" link.' ) . '</td>' .'</tr>' .'</table>' - . tra("Example: ") . '{maketoc maxdepth=3 include=all backtotop=true}'; + . tra("Example: ") . '{MAKETOC maxdepth=3 include=all backtotop=true}'; return $help; } @@ -75,13 +75,13 @@ function data_maketoc( $data ) { } // get all headers into an array - preg_match_all( "/<h(\d).*?>.*?<\/h.>/i", $data, $headers ); + preg_match_all( "/<h(\d).*?>(.*?)<\/h.>/i", $data, $headers ); // remove any html tags from the output text and generate link ids - foreach( $headers[0] as $output ) { - $output = preg_replace( "/<.*?>/", '', $output ); - $outputs[] = $output; - $anchors[] = 'id'.microtime() * 1000000; + foreach( $headers[2] as $output ) { + $outputs[] = preg_replace( "/<.*?>/", "", $output ); + $anchor = preg_replace( "/[^\w|\d]*/", "", $output ); + $anchors[] = !empty( $anchor) ? $anchor : 'id'.microtime() * 1000000; } // insert the <a name> tags in the right places diff --git a/plugins/data.pluginhelp.php b/plugins/data.pluginhelp.php index db138bb..07867dd 100644 --- a/plugins/data.pluginhelp.php +++ b/plugins/data.pluginhelp.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -17,7 +17,7 @@ // | Rewritten for bitweaver by Author // | wikiplugin_pluginhelp.php - see deprecated code below // +----------------------------------------------------------------------+ -// $Id: data.pluginhelp.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.pluginhelp.php,v 1.3 2005/07/17 17:36:10 squareing Exp $ /** * definitions @@ -32,7 +32,7 @@ $pluginParams = array ( 'tag' => 'PLUGINHELP', // 'title' => 'PluginHelp', // and Remove the comment from the start of this line 'help_page' => 'DataPluginPluginHelp', 'description' => tra("This plugin will display the plugin's Help."), - 'help_function' => 'data__pluginhelp_help', + 'help_function' => 'data_pluginhelp_help', 'syntax' => "{PLUGINHELP plugin= }", 'plugin_type' => DATA_PLUGIN ); diff --git a/plugins/data.sf.php b/plugins/data.sf.php index 2eb5a4a..3769650 100644 --- a/plugins/data.sf.php +++ b/plugins/data.sf.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ * @package Liberty * @subpackage plugins_data */ @@ -17,7 +17,7 @@ // | Reworked & Undoubtedly Screwed-Up for (Bitweaver) // | by: StarRider <starrrider@sourceforge.net> // +----------------------------------------------------------------------+ -// $Id: data.sf.php,v 1.3 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.sf.php,v 1.4 2005/07/17 17:36:10 squareing Exp $ /** * definitions @@ -32,8 +32,8 @@ $pluginParams = array ( 'tag' => 'SF', 'load_function' => 'data_sf', 'title' => 'SourceForge (SF)', 'help_page' => 'DataPluginSourceForge', - 'description' => tra("Creates a link to SourceForge. Can be to the Bugs / RFEs / Patches / Support pages. Can also be to individual item.."), - 'help_function' => 'data__sf_help', + 'description' => tra("Creates a link to SourceForge. Can link to the Bugs / RFEs / Patches / Support Index pages or individual items on those pages."), + 'help_function' => 'data_sf_help', 'syntax' => "{SF tag= aid= groupid= atid= }", 'plugin_type' => DATA_PLUGIN ); diff --git a/plugins/data.sort.php b/plugins/data.sort.php index 59da6a4..8334bcc 100644 --- a/plugins/data.sort.php +++ b/plugins/data.sort.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -17,7 +17,7 @@ // | Reworked & Undoubtedly Screwed-Up for (Bitweaver) // | by: StarRider <starrrider@sourceforge.net> // +----------------------------------------------------------------------+ -// $Id: data.sort.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.sort.php,v 1.3 2005/07/17 17:36:10 squareing Exp $ /** * definitions @@ -31,7 +31,7 @@ $pluginParams = array ( 'tag' => 'SORT', 'title' => 'Sort', 'help_page' => 'DataPluginSort', 'description' => tra("This plugin sorts operates on lines of text - not the text in the lines. Every line between the ") . "~np~{SORT}~/np~" . tra(" blocks - including the lines the blocks are on - is sorted."), - 'help_function' => 'data__sort_help', + 'help_function' => 'data_sort_help', 'syntax' => "{SORT sort= }" . tra("Lines to be sorted") . "{SORT}", 'plugin_type' => DATA_PLUGIN ); diff --git a/plugins/data.split.php b/plugins/data.split.php index 5e8d55d..e3a2468 100644 --- a/plugins/data.split.php +++ b/plugins/data.split.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -18,7 +18,7 @@ // | by: StarRider <starrrider@users.sourceforge.net> // | Reworked from: wikiplugin_split.php - see deprecated code below // +----------------------------------------------------------------------+ -// $Id: data.split.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.split.php,v 1.3 2005/07/17 17:36:10 squareing Exp $ /** * definitions @@ -33,7 +33,7 @@ $pluginParams = array ( 'tag' => 'SPLIT', // 'title' => 'Split', // and Remove the comment from the start of this line 'help_page' => 'DataPluginSplit', 'description' => tra("This plugin is used to split a page in two or more columns using __-~045~-__ as a seperator."), - 'help_function' => 'data__split_help', + 'help_function' => 'data_split_help', 'syntax' => "{SPLIT joincols= fixedsize= }{SPLIT}", 'plugin_type' => DATA_PLUGIN ); diff --git a/plugins/data.spytext.php b/plugins/data.spytext.php new file mode 100644 index 0000000..6fd695f --- /dev/null +++ b/plugins/data.spytext.php @@ -0,0 +1,324 @@ +<?php +// $id: +/** + * assigned_modules + * + * @author StarRider starrrider@sourceforge.net + * @version $Revision: 1.2 $ + * @package liberty + * @subpackage plugins_data + * @copyright Copyright (c) 2004, bitweaver.org + * All Rights Reserved. See copyright.txt for details and a complete list of authors. + * @license Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. + */ + +/****************** + * Initialization * + ******************/ + +global $gLibertySystem; +define( 'PLUGIN_GUID_SPYTEXT', 'spytext' ); +$pluginParams = array ( 'tag' => 'SPYTEXT', + 'auto_activate' => TRUE, + 'requires_pair' => TRUE, + 'load_function' => 'data_spytext', + 'title' => 'Spy Text (SPYTEXT)', + 'help_page' => 'DataPluginSpyText', + 'description' => tra("Allows text to be stored that is only visible to a List of Spys or to a Spy Agency (Group). To anyone else (except an Admin) the text is not be visible."), + 'help_function' => 'data_spytext_help', + 'syntax' => "{SPYTEXT spy= agency= sender= to= hidden= title= width= icon= alert= }", + 'plugin_type' => DATA_PLUGIN + ); +$gLibertySystem->registerPlugin( PLUGIN_GUID_SPYTEXT, $pluginParams ); +$gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_SPYTEXT ); + +/***************** + * Help Function * + *****************/ +function data_spytext_help() { + $help = + '<table class="data help">' + .'<tr>' + .'<th>' . tra( "Key" ) . '</th>' + .'<th>' . tra( "Type" ) . '</th>' + .'<th>' . tra( "Comments" ) . '</th>' + .'</tr>' + .'<tr class="odd">' + .'<td>spy</td>' + .'<td>' . tra( "UserName(s)") . '<br />' .tra( "(optional)") . '</td>' + .'<td>' . tra( "A List of Spy(s) who can see the Message. Each Spy must be seperated with the | character like this:") + ."<br /><strong>spy='Fire|Spider|Lester|Xing'</strong>" + .'<br />' .tra( "The Message will <strong>ONLY</strong> be displayed to Spys. <strong>HINT:</strong> The Admin is a Spy!") + . '</td>' + .'</tr>' + .'<tr class="even">' + .'<td>agency</td>' + .'<td>' . tra( "GroupName(s)") . '<br />' .tra( "(optional)") . '</td>' + .'<td>' . tra( "A List of Spy Agency(s) (Groups) that will be allowed to see the Messages. Each Agency must be seperated ") + .tra( "with the | character like this:") + ."<br /><strong>agency='Devellopers|Editors'</strong>" + .'<br />' .tra( "The Message will <strong>ONLY</strong> be displayed to Spys. <strong>HINT:</strong> The Admin is a Spy!") + .'</td>' + .'</tr>' + .'<tr class="odd">' + .'<td>sender</td>' + .'<td>' . tra( "UserName") . '<br />' .tra( "(optional)") . '</td>' + .'<td>' . tra( "A List of Spy(s) who wrote the Message. Each Author must be seperated with the | character like this:") + ."<br /><strong>sender='StarRider|Wolffy'</strong>" + .'</td>' + .'</tr>' + .'<tr class="even">' + .'<td>to</td>' + .'<td>' . tra( "boolean/string") . '<br />' .tra( "(optional)") . '</td>' + .'<td>' .tra( "Determines if an Address Box will be displayed before the Message. The Address Box is always in it's own ") + .tra( "DropDown box which contains 3 lines where the") .' <strong>spy(s) / agency(s) / & sender(s)</strong> ' + .tra( "are identified. These lines are only displayed if a valid UserName / GroupName is found for that line. ") + .'<br />' . tra( "The Default Header for each line is:") + .'<br />Line 1 for Spy (Users) = <strong>"To the Spy:"</strong> ' + .'<br />Line 2 for Agency (Groups) = <strong>"To the Agency:"</strong> ' + .'<br />Line 3 for Sender (Users) = <strong>"From Your Source(s):"</strong> ' + .'<br />'. tra( "The Address Box is <strong>NOT</strong> displayed by Default. Specifing") + ."<br /><strong>to='TRUE'</strong> ". tra( "will enable the Address Box with the Default Headers. The Address Headers can ") + .tra( "be redefined by using the the | character to seperate the headers like this:") + ."<br /><strong>to='To My Friends:|To My Colleagues In:|Your Friend:'</strong>" . tra( "The * character can also be used ") + .tra( 'to say "Use This Default" but Replace this one. - Like this:') + ."<br /><strong>to='*|*|From the Sexiest Spy Ever:'</strong>" + .'</td>' + .'</tr>' + .'<tr class="odd">' + .'<td>hidden</td>' + .'<td>' . tra( "boolean") . '<br />' . tra("(optional)") . '</td>' + .'<td>' . tra( "Determines if the message is in a Stationary or DropDown Box.") + .tra( "<br />By Default: <strong>Every</strong> SpyText Message is encased in a Stationary Box. Passing ") + .tra( "<strong>Any</strong> value in this parameter will cause the Message to become a DropDown Box. The link that ") + .tra( "<strong>Expands/Contracts</strong> the DropDown Box is supplied by the parameters") + . ' <strong>title or icon</strong>. ' + .'</td>' + .'</tr>' + .'<tr class="even">' + .'<td>title</td>' + .'<td>' . tra( "string") . '<br />' . tra("(optional)") . '</td>' + .'<td>' . tra( "The Title Bar is something like a Horizontal Rule with the Text Centered on it. It is used as a link to") + .tra( " <strong>Expand/Contract</strong> a") .' <strong>hidden</strong> ' . tra( "Message Box.") + .'<br />' . tra( "The Title Bar is only visible when the Message Box is") . ' <strong>hidden</strong> ' + .'<br />' . tra( "By Default Title used by the Title Bar is") . ' <strong>"A Hidden Message"</strong>. ' + .'<br />' . tra( "Specifying any value in this parameter will change the Default Title.") + .'</td>' + .'</tr>' + .'<tr class="odd">' + .'<td>width</td>' + .'<td>' . tra( "numeric") . '<br />' . tra("(optional)") . '</td>' + .'<td>' . tra( "Controls the width of the text area on the Title Bar. The value is a percentage of available space but") + .tra( " <strong>Do Not</strong> include the % character.") + .'<br />' . tra( "The Default =") . ' <strong>20</strong>' + .'</td>' + .'</tr>' + .'<tr class="even">' + .'<td>icon</td>' + .'<td>' . tra( "URL/Content Id #") . '<br />' . tra("(optional)") . '</td>' + .'<td>' . tra( "An Icon can be used as the link to display the Message Box if desired. When activated, the Title becomes ") + .tra( "part of the") . ' <strong>hidden</strong> ' . tra( "Message Box.") + .tra( "<br />By Default - an Icon is <strong>Not</strong> displayed. Specifing :") + ."<br /><strong>icon='TRUE'</strong> ". tra( "will cause the Default Icon to be displayed. Any Image stored on the site ") + .tra( "can be used by specifing it's Content Id Number like this:") + ."<br /><strong>icon='#125'</strong> ". tra( "<strong>Please Note:</strong> the # character Must be included.") + .tra( "Any other value specified in this parameter is assumed to be a <strong>Valid URL</strong>.") + .'<br />' . tra( "<strong>Note:</strong> - a listing of Content Id's can be found ") + .'<a href="'.LIBERTY_PKG_URL.'list_content.php" title="Launch BitWeaver Content Browser in New Window" ' + .'onkeypress="popUpWin(this.href,\'standard\',800,800);" onclick="popUpWin(this.href,\'standard\',800,800);return false;">' + .tra( "Here" ) . '</a> ' + .'</td>' + .'</tr>' + .'<tr class="odd">' + .'<td>alert</td>' + .'<td>' . tra( "boolean/string") . '<br />' .tra( "(optional)") . '</td>' + .'<td>' . tra( "Determines if an Alert Box is attached to the page. This is intended to provide the Less-Than-Swift Spy ") + .tra( "with a Subtle Hint that there just might be something for them to look at.") + .'<br />' . tra( "The Alert Box is <strong>Never</strong> displayed by Default. Specifing:") + ."<br /><strong>alert='TRUE'</strong> ". tra( "will enable the Alert Box with the Default Headers. The Default Headers is:") + .'<br /><strong>"Wake Up Charlie! There is a message on this page for you. Use your Secret Decoder Ring!"</strong> ' + .tra( "<br />In this instance - <strong>Charlie</strong> is the UserName of the user viewing the page. The string:") + .'<br /><strong>*UserName*<strong> ' . tra("is replaced with name of the spy viewing the page every place it is found.") + .tra( "Passing <strong>ANY</strong> other value will replace Default Message.") + .'<br />' . tra( "<strong>Note:</strong> The Administrator is a Spy and will be Alerted - with a slightly different message.") + .'</td>' + .'</tr>' + .'</table>'; + return $help; +} + +/***************** + * Load Function * + *****************/ +function data_spytext($data, $params) { + global $gLibertySystem; + global $gBitUser; + extract ($params); + + if (empty($data)) { // If there is NO data to display - why do anything - get out of here + return " "; + } // **************** Elvis has left the building! + + $isSpy = ($gBitUser->isAdmin()) ? TRUE : FALSE; // Admin should always see SpyText + $isRealSpy = FALSE; // So Admin does not see EVERY Alert + if (isset($spy)) { // Is the current user on the Spy List + $spyArray = explode("|", trim(strtolower($spy))); // spy's allowed to see the message + foreach ($spyArray as $i) { + if ($i == (strtolower($gBitUser->getTitle()))) { + $isSpy = TRUE; + $isRealSpy = TRUE; + } } } + + if (isset($agency)) { // Is the current user in one of the Spy Agencies + $spyArray = explode("|", trim(strtolower($agency))); // create an array from the string + $groups = $gBitUser->getGroups(); + foreach ($spyArray as $i) { + foreach ($groups as $g) { + if (trim(strtolower($g['group_name'])) == $i) { + $isSpy = TRUE; + $isRealSpy = TRUE; + } } } } + + if (!$isSpy) { // The current user is NOT a Spy - get out of here + return " "; + } // **************** Elvis has left the building! + + $addToBox = (isset($to)) ? TRUE : FALSE; + if ($addToBox) { + $toLine = 'To the Spy: '; // Set Default + $agencyLine = 'To the Agency: '; // Set Default + $senderLine = 'From Your Source: '; // Set Default + $header = explode("|", $to); + $toLine = (isset($header[0]) && (($header[0] != '*') && ($header[0] != 'TRUE'))) ? $header[0] .' ' : $toLine; + $agencyLine = (isset($header[1]) && ($header[1] != '*')) ? $header[1] .' ' : $agencyLine; + $senderLine = (isset($header[2]) && ($header[2] != '*')) ? $header[2] .' ' : $senderLine; + + $addToLine = FALSE; + if (isset($spy)) { // Provide a Listing of all spys tested + $spyArray = explode("|", $spy); // Strip Out the | character + natcasesort ($spyArray); // Sort it + foreach ($spyArray as $i) { + if ($gBitUser->userExists(array('login' => $i))) { + $toLine = ($addToLine) ? $toLine . ', ' : $toLine; // misses the first and last Spy + $toLine = $toLine.(BitUser::getDisplayName( TRUE, array('login' => $i))); + $addToLine = True; + } } + $toLine = '<tr><td style="vertical-align: top;">' .$toLine. '</td></tr>'; + } + + $addAgencyLine = FALSE; + if (isset($agency)) { // Provide a Listing of all agencies tested + $agency_array = explode("|", $agency); // Strip Out the | character + natcasesort ($agency_array); // Sort it + $listHash = array( 'sort_mode' => 'group_name_asc' ); + $groups = $gBitUser->getAllGroups( $listHash ); + foreach ($agency_array as $i) { // TODO - Remove all Non-valid groups - ($i == $i) + if( $groupId = $gBitUser->groupExists( $i ) ) { + $validGroups[$groupId] = $i; + $agencyLine = ($addAgencyLine) ? $agencyLine .', ' : $agencyLine; // misses the first and last Agency + $agencyLine = $agencyLine . '<strong>' .$i. '</strong>'; + $addAgencyLine = True; + } else { + $k = key( $agency_array ); + unset( $agency_array[$k] ); + } } + $agencyLine = '<tr><td style="vertical-align: top;">' . $agencyLine . '</td></tr>'; + } + + $addSenderLine = FALSE; + if (isset($sender)) { // Provide a Listing of all senders tested + $spyArray = explode("|", $sender); // Strip Out the | character + natcasesort ($spyArray); // Sort it + foreach ($spyArray as $i) { // TODO - Remove All Non-valid users - ($i == $i) + if ($gBitUser->userExists(array('login' => $i))) { + $senderLine = ($addSenderLine) ? $senderLine . ', ' : $senderLine; // misses the first and last Spy + $senderLine = $senderLine.(BitUser::getDisplayName( TRUE, array('login' => $i))); + $addSenderLine = TRUE; + } } + $senderLine = '<tr><td style="vertical-align: top;">' . $senderLine . '</td></tr>'; + } + + $ab = (microtime() * 1000000); + $toHeader = '<div>' + .'<table width="100%" border="0" cellspacing="0" cellpadding="0">' + .'<tr>' + .'<td width=42%><hr></td>' + .'<td style="text-align:center">' + .'<a title="Expand/Contract for Addresses" href="javascript:flip(' .$ab. ')">Address</a>' + .'</td>' + .'<td width=42%><hr></td>' + .'</tr>' + .'</table>' + .'</div>'; + + $addToBox = ($addToBox && ($addToLine || ($addAgencyLine || $addSenderLine))) ? TRUE : FALSE; + if ($addToBox) { + $toBox = '<div>'; // Wrap's Arround Everything in toBox + $toBox = $toBox . $toHeader . '<div style="display:none;" id="' .$ab. '"><table border="1">'; + $toBox = ($addToLine) ? $toBox . $toLine : $toBox; // Drop toLine if nothing on it + $toBox = ($addAgencyLine) ? $toBox . $agencyLine : $toBox; // Drop agencyLine if nothing on it + $toBox = ($addSenderLine) ? $toBox . $senderLine : $toBox; // Drop fromLine if nothing on it + $toBox = $toBox . '</table></div>'; + $toBox = $toBox . '</div>'; + } } + + $mt = (microtime() * 1000000); + $hidden = (isset($hidden)) ? TRUE : FALSE; + if ($hidden) { + $useIcon = (isset($icon)) ? TRUE : FALSE; + if ($useIcon) { + if ((trim(strtoupper($icon))) == 'TRUE') + $spyLink = '<a href="javascript:flip('.$mt.')"><img src="'.LIBERTY_PKG_URL.'icons/spy.gif"></img></a>'; // Default + // --------------------------> TODO - Need to set with Content Id No's + if (!isset($spyLink)) { + $spyLink = '<a href="javascript:flip('.$mt.')"><img src="'.$icon.'"></img></a>'; // Last Choice - A URL + } else { + $spyLink = '<a href="javascript:flip('.$mt.')"><img src="'.LIBERTY_PKG_URL.'icons/spy.gif"></img></a>'; // Default + } // Place the default last + } else { // It's not linked to an Icon - so - It needs Title Bar + $width = (isset($width)) ? $width : '20'; + $width = ((100 - $width) / 2) . '%'; + $title = (isset($title)) ? $title : 'A Hidden Message'; + $spyLink = '<div>' + .'<table width="100%" border="0" cellspacing="0" cellpadding="0">' + .'<tr>' + .'<td width='.$width.'><hr></td>' + .'<td style="text-align:center">' + .'<a title="Expand/Contract for Hidden Text" href="javascript:flip('.$mt.')">'.$title.'</a>' + .'</td>' + .'<td width='.$width.'><hr></td>' + .'</tr>' + .'</table>' + .'</div>'; + } } + $ret = ($hidden) ? $spyLink. '<div class="help box" style="display:none;" id="' .$mt. '">' : ''; + $ret = ($addToBox) ? $ret.$toBox : $ret; + $ret = $ret .'<div class="help box" style="text-align:left;">'.$data.'</div>'; + $ret = ($hidden) ? $ret.'</div>' : $ret; + +// I'm NOT Sure if this should be include or not - especially the way I have it set up +// I have reduced the number of Alerts that an Admin would recieve - Only Hidden Messages + $spyAlert = FALSE; + if (isset($alert)) { + if (strtoupper(trim($alert)) == 'TRUE') { + $spyAlert = TRUE; + $spyMsg = ($isRealSpy) ? 'Wake Up *UserName*!\nThere is a message on this page for you.\nUse your Secret Decoder Ring!' : ''; + } else { + $spyAlert = TRUE; + $spyMsg = $alert; + } } + if (($gBitUser->isAdmin()) && ($hidden)) { + $spyMsg = '*UserName*\nThere is Hidden SpyText on this page.'; + $spyAlert = TRUE; + } + if ($spyAlert) { + $spyArray = explode("*", $spyMsg); // Process the *UserName* + for ($i = 0; $i <= ((count($spyArray))-1); $i++) { + $spyArray[$i] = (trim(strtoupper($spyArray[$i])) == 'USERNAME') ? $gBitUser->getTitle() : $spyArray[$i]; + } + $spyMsg = implode(" ", $spyArray); + echo "<script>window.alert(\"" .$spyMsg. "\");</script>"; + } + return $ret; +} +?> diff --git a/plugins/data.titlesearch.php b/plugins/data.titlesearch.php index 0aa7e42..27fba3d 100644 --- a/plugins/data.titlesearch.php +++ b/plugins/data.titlesearch.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -18,7 +18,7 @@ // | by: StarRider <starrrider@users.sourceforge.net> // | Reworked from: wikiplugin_titlesearch.php - see deprecated code below // +----------------------------------------------------------------------+ -// $Id: data.titlesearch.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.titlesearch.php,v 1.3 2005/07/17 17:36:10 squareing Exp $ /** * definitions @@ -33,7 +33,7 @@ $pluginParams = array ( 'tag' => 'TITLESEARCH', // 'title' => 'TitleSearch', // and Remove the comment from the start of this line 'help_page' => 'DataPluginTitleSearch', 'description' => tra("This plugin search the titles of all pages in this wiki."), - 'help_function' => 'data__titlesearch_help', + 'help_function' => 'data_titlesearch_help', 'syntax' => "{TITLESEARCH search= info= exclude= noheader= }", 'plugin_type' => DATA_PLUGIN ); diff --git a/plugins/data.toc.php b/plugins/data.toc.php index 9afdcb9..26e79bc 100644 --- a/plugins/data.toc.php +++ b/plugins/data.toc.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -15,7 +15,7 @@ // +----------------------------------------------------------------------+ // | Author: Christian Fowler <spiderr@users.sourceforge.net> // +----------------------------------------------------------------------+ -// $Id: data.toc.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.toc.php,v 1.3 2005/07/17 17:36:10 squareing Exp $ /** * definitions @@ -28,27 +28,27 @@ global $gLibertySystem; $pluginParams = array ( 'tag' => 'toc', 'auto_activate' => TRUE, 'requires_pair' => FALSE, - 'load_function' => 'toc_parse_data', - 'title' => 'Table Of Contents', + 'load_function' => 'data_toc', + 'title' => 'Table Of Contents (TOC)', 'help_page' => 'DataPluginTOC', 'description' => tra("Display a Table Of Contents for Structures"), - 'help_function' => 'toc_extended_help', + 'help_function' => 'data_toc_help', 'syntax' => '{TOC sturcture_id= }', 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_TOC, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_TOC ); -function toc_extended_help() { - return 'NO HELP WRITTEN FOR {toc}'; +function data_toc_help() { + return 'NO HELP WRITTEN FOR {TOC}'; } -function toc_parse_data( $data, $params ) { +function data_toc( $data, $params ) { $repl = ''; include_once( LIBERTY_PKG_PATH.'LibertyStructure.php' ); global $gStructure, $gContent; $struct = NULL; - if( empty( $gStructure ) || !$gStructure->isValid() ) { + if( is_object( $gContent ) && (empty( $gStructure ) || !$gStructure->isValid()) ) { $structures = $gContent->getStructures(); // We take the first structure. not good, but works for now - spiderr if( !empty( $structures[0] ) ) { diff --git a/plugins/data.translated.php b/plugins/data.translated.php index a05cec4..45bdbb2 100644 --- a/plugins/data.translated.php +++ b/plugins/data.translated.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -18,7 +18,7 @@ // | by: StarRider <starrrider@sourceforge.net> // | Reworked from: wikiplugin_translated.php - see deprecated code below // +----------------------------------------------------------------------+ -// $Id: data.translated.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.translated.php,v 1.3 2005/07/17 17:36:10 squareing Exp $ /** * definitions @@ -33,7 +33,7 @@ $pluginParams = array ( 'tag' => 'TRANSLATED', // 'title' => 'Translated', // and Remove the comment from the start of this line 'help_page' => 'DataPluginTranslated', 'description' => tra("This plugin is used to create a link to a page that contains a translation. The link can be shown as an Icon for the country or as an abreviation for the language."), - 'help_function' => 'data__translated_help', + 'help_function' => 'data_translated_help', 'syntax' => "{TRANSLATED page= lang= flag= }", 'plugin_type' => DATA_PLUGIN ); diff --git a/plugins/data.usercount.php b/plugins/data.usercount.php index 341be35..ac2a0fd 100644 --- a/plugins/data.usercount.php +++ b/plugins/data.usercount.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -18,7 +18,7 @@ // | by: StarRider <starrrider@sourceforge.net> // | Reworked from: wikiplugin_usercount.php - see deprecated code below // +----------------------------------------------------------------------+ -// $Id: data.usercount.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.usercount.php,v 1.3 2005/07/17 17:36:10 squareing Exp $ /** * definitions @@ -33,7 +33,7 @@ $pluginParams = array ( 'tag' => 'USERCOUNT', // 'title' => 'UserCount', // and Remove the comment from the start of this line 'help_page' => 'DataPluginUserCount', 'description' => tra("Will show the number of users. If a Group Name can be included to filter the Groups."), - 'help_function' => 'data__usercount_help', + 'help_function' => 'data_usercount_help', 'syntax' => "{USERCOUNT}Group Name{USERCOUNT}", 'plugin_type' => DATA_PLUGIN ); diff --git a/plugins/data.userlist.php b/plugins/data.userlist.php index 80a83f7..0bfa9bd 100644 --- a/plugins/data.userlist.php +++ b/plugins/data.userlist.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -18,7 +18,7 @@ // | by: StarRider <starrrider@sourceforge.net> // | Reworked from: wikiplugin_userlist.php - see deprecated code below // +----------------------------------------------------------------------+ -// $Id: data.userlist.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.userlist.php,v 1.3 2005/07/17 17:36:10 squareing Exp $ /** * definitions @@ -33,7 +33,7 @@ $pluginParams = array ( 'tag' => 'USERLIST', // 'title' => 'UserList',, // and Remove the comment from the start of this line 'help_page' => 'DataPluginUserList', 'description' => tra("This plugin will displays an alphabetically sorted list of registered users. A Group Name can be included to filter Groups to be listed."), - 'help_function' => 'data__userlist_help', + 'help_function' => 'data_userlist_help', 'syntax' => "{USERLIST num= userspage= alpha= total= email= }GroupName{USERLIST}", 'plugin_type' => DATA_PLUGIN ); diff --git a/plugins/data.wikilist.php b/plugins/data.wikilist.php index 177fa37..4e58098 100644 --- a/plugins/data.wikilist.php +++ b/plugins/data.wikilist.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_data */ @@ -18,7 +18,7 @@ // | by: StarRider <starrrider@sourceforge.net> // | Reworked from: wikiplugin_wikilist.php - see deprecated code below // +----------------------------------------------------------------------+ -// $Id: data.wikilist.php,v 1.2 2005/06/28 07:45:48 spiderr Exp $ +// $Id: data.wikilist.php,v 1.3 2005/07/17 17:36:10 squareing Exp $ /** * definitions @@ -33,7 +33,7 @@ $pluginParams = array ( 'tag' => 'WIKILIST', // 'title' => 'WikiList', // and Remove the comment from the start of this line 'help_page' => 'DataPluginWikiList', 'description' => tra("Displays an alphabetically sorted list of WikiPages"), - 'help_function' => 'data__wikilist_help', + 'help_function' => 'data_wikilist_help', 'syntax' => "{WIKILIST num= alpha= total= list= }Group Name{WIKILIST} ", 'plugin_type' => DATA_PLUGIN ); diff --git a/plugins/format.pearwiki.php b/plugins/format.pearwiki.php index e9d2fd8..bb6afed 100644 --- a/plugins/format.pearwiki.php +++ b/plugins/format.pearwiki.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_format */ @@ -8,53 +8,53 @@ /** * definitions */ -if( @include_once( 'Text/Wiki.php' ) ) { - global $gLibertySystem; - - define( 'PLUGIN_GUID_PEARWIKI', 'pearwiki' ); - - $pluginParams = array ( 'store_function' => 'pearwiki_save_data', - 'load_function' => 'pearwiki_parse_data', - 'verify_function' => 'pearwiki_verify_data', - 'auto_activate' => TRUE, - 'description' => 'Pear Wiki Syntax Format Parser. Requires Text_Wiki Pear extension. If you are running linux you can try running: su -c \'pear install Text_Wiki\'. More info <a href="http://wiki.ciaweb.net/yawiki/index.php?area=Text_Wiki&page=SamplePage">here</a>', - 'edit_label' => 'Pear Text_Wiki Syntax', - 'edit_field' => '<input type="radio" name="format_guid" value="'.PLUGIN_GUID_PEARWIKI.'"', - 'help_page' => 'PearWikiSyntax', - 'plugin_type' => FORMAT_PLUGIN - ); - - $gLibertySystem->registerPlugin( PLUGIN_GUID_PEARWIKI, $pluginParams ); - - function pearwiki_save_data( &$pParamHash ) { - static $parser; - require_once 'Text/Wiki.php'; - if( empty( $parser ) ) { - $parser =& new Text_Wiki(); - } +global $gLibertySystem; + +define( 'PLUGIN_GUID_PEARWIKI', 'pearwiki' ); + +$auto_activate = ( @include_once( 'Text/Wiki.php' ) ? TRUE : FALSE ); + +$pluginParams = array ( 'store_function' => 'pearwiki_save_data', + 'load_function' => 'pearwiki_parse_data', + 'verify_function' => 'pearwiki_verify_data', + 'auto_activate' => $auto_activate, + 'description' => 'Pear Wiki Syntax Format Parser. Requires Text_Wiki Pear extension. If you are running linux you can try running: su -c \'pear install Text_Wiki\'. More info <a href="http://wiki.ciaweb.net/yawiki/index.php?area=Text_Wiki&page=SamplePage">here</a>', + 'edit_label' => 'Pear Text_Wiki Syntax', + 'edit_field' => '<input type="radio" name="format_guid" value="'.PLUGIN_GUID_PEARWIKI.'"', + 'help_page' => 'PearWikiSyntax', + 'plugin_type' => FORMAT_PLUGIN + ); + +$gLibertySystem->registerPlugin( PLUGIN_GUID_PEARWIKI, $pluginParams ); + +function pearwiki_save_data( &$pParamHash ) { + static $parser; + require_once 'Text/Wiki.php'; + if( empty( $parser ) ) { + $parser =& new Text_Wiki(); } - - function pearwiki_verify_data( &$pParamHash ) { - $errorMsg = NULL; - $pParamHash['content_store']['data'] = $pParamHash['edit']; - return( $errorMsg ); +} + +function pearwiki_verify_data( &$pParamHash ) { + $errorMsg = NULL; + $pParamHash['content_store']['data'] = $pParamHash['edit']; + return( $errorMsg ); +} + +function pearwiki_parse_data( &$pData, &$pCommonObject ) { + static $parser; + require_once 'Text/Wiki.php'; + if( empty( $parser ) ) { + $parser =& new Text_Wiki(); } - - function pearwiki_parse_data( &$pData, &$pCommonObject ) { - static $parser; - require_once 'Text/Wiki.php'; - if( empty( $parser ) ) { - $parser =& new Text_Wiki(); - } - $xhtml = $parser->transform($pData, 'Xhtml'); + $xhtml = $parser->transform($pData, 'Xhtml'); - global $gLibertySystem; - // create a table of contents for this page - // this function is called manually, since it processes the HTML code - if( preg_match( "/\{maketoc.*?\}/", $xhtml ) && @$gLibertySystem->mPlugins['datamaketoc']['is_active'] == 'y' ) { - $xhtml= data_maketoc($xhtml); - } - return $xhtml; + global $gLibertySystem; + // create a table of contents for this page + // this function is called manually, since it processes the HTML code + if( preg_match( "/\{maketoc.*?\}/", $xhtml ) && @$gLibertySystem->mPlugins['datamaketoc']['is_active'] == 'y' ) { + $xhtml= data_maketoc($xhtml); } + return $xhtml; } ?> diff --git a/plugins/format.pearwiki_tiki.php b/plugins/format.pearwiki_tiki.php index 294fcf8..9269567 100644 --- a/plugins/format.pearwiki_tiki.php +++ b/plugins/format.pearwiki_tiki.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package Liberty * @subpackage plugins_format */ @@ -9,62 +9,62 @@ /** * definitions */ -if( @include_once( 'Text/Wiki.php' ) ) { - global $gLibertySystem; - - define( 'PLUGIN_GUID_PEARWIKI_TIKI', 'pearwiki_tiki' ); - - $pluginParams = array ( 'store_function' => 'pearwiki_tiki_save_data', - 'load_function' => 'pearwiki_tiki_parse_data', - 'verify_function' => 'pearwiki_tiki_verify_data', - 'auto_activate' => TRUE, - 'description' => 'Pear Wiki Parser for TikiWiki Syntax. Requires Text_Wiki Pear extension. More info <a href="http://wiki.ciaweb.net/yawiki/index.php?area=Text_Wiki&page=SamplePage">here</a>', - 'edit_label' => 'Tiki Wiki Syntax, parsed by Pear::Text_Wiki', - 'edit_field' => '<input type="radio" name="format_guid" value="'.PLUGIN_GUID_PEARWIKI_TIKI.'"', - 'help_page' => 'TikiWikiSyntax', - 'plugin_type' => FORMAT_PLUGIN - ); - - $gLibertySystem->registerPlugin( PLUGIN_GUID_PEARWIKI_TIKI, $pluginParams ); - - function pearwiki_tiki_save_data( &$pParamHash ) { - } - - function pearwiki_tiki_verify_data( &$pParamHash ) { - $errorMsg = NULL; - $pParamHash['content_store']['data'] = $pParamHash['edit']; - return( $errorMsg ); - } - - function pearwiki_tiki_parse_data( &$pData, &$pCommonObject ) { - static $parser; - if( empty( $parser ) ) { - define('PAGE_SEP', 'PAGE MARKER HERE*&^%$#^$%*PAGEMARKERHERE'); +global $gLibertySystem; - require_once(dirname(__FILE__).'/../../util/pear/Text/Wiki/Tiki.php'); - $parser =& new Text_Wiki_Tiki(); - $parser->setRenderConf('xhtml', 'wikilink', 'exists_callback', array(&$pCommonObject, 'pageExists')); - $parser->setRenderConf('xhtml', 'wikilink', 'view_url', 'index.php?page='); - $parser->setRenderConf('xhtml', 'wikilink', 'new_url', 'edit.php?page='); - $parser->setRenderConf('xhtml', 'table', 'css_table', 'wikitable'); - $parser->setRenderConf('xhtml', 'table', 'css_td', 'wikicell'); - //$parser->setFormatConf('Xhtml', 'translate', false); - /*$extwiki = array(); - $extwikiSth = $this->query('SELECT `extwiki`, `name` FROM `tiki_extwiki`'); - while ($rec = $extwikiSth->fetchRow()) { - $extwiki[$rec['name']] = str_replace('$page', '%s', $rec['extwiki']); - } - $parser->setRenderConf('xhtml', 'interwiki', 'sites', $extwiki);*/ - } - $xhtml = $parser->transform($pData, 'Xhtml'); +define( 'PLUGIN_GUID_PEARWIKI_TIKI', 'pearwiki_tiki' ); - global $gLibertySystem; - // create a table of contents for this page - // this function is called manually, since it processes the HTML code - /*if( preg_match( "/\{maketoc.*?\}/", $xhtml ) && @$gLibertySystem->mPlugins['datamaketoc']['is_active'] == 'y' ) { - $xhtml= data_maketoc($xhtml); - }*/ - return $xhtml; +$auto_activate = ( @include_once( 'Text/Wiki.php' ) ? TRUE : FALSE ); + +$pluginParams = array ( 'store_function' => 'pearwiki_tiki_save_data', + 'load_function' => 'pearwiki_tiki_parse_data', + 'verify_function' => 'pearwiki_tiki_verify_data', + 'auto_activate' => $auto_activate, + 'description' => 'Pear Wiki Parser for TikiWiki Syntax. Requires Text_Wiki Pear extension. More info <a href="http://wiki.ciaweb.net/yawiki/index.php?area=Text_Wiki&page=SamplePage">here</a>', + 'edit_label' => 'Tiki Wiki Syntax, parsed by Pear::Text_Wiki', + 'edit_field' => '<input type="radio" name="format_guid" value="'.PLUGIN_GUID_PEARWIKI_TIKI.'"', + 'help_page' => 'TikiWikiSyntax', + 'plugin_type' => FORMAT_PLUGIN + ); + +$gLibertySystem->registerPlugin( PLUGIN_GUID_PEARWIKI_TIKI, $pluginParams ); + +function pearwiki_tiki_save_data( &$pParamHash ) { +} + +function pearwiki_tiki_verify_data( &$pParamHash ) { + $errorMsg = NULL; + $pParamHash['content_store']['data'] = $pParamHash['edit']; + return( $errorMsg ); +} + +function pearwiki_tiki_parse_data( &$pData, &$pCommonObject ) { + static $parser; + if( empty( $parser ) ) { + define('PAGE_SEP', 'PAGE MARKER HERE*&^%$#^$%*PAGEMARKERHERE'); + + require_once(dirname(__FILE__).'/../../util/pear/Text/Wiki/Tiki.php'); + $parser =& new Text_Wiki_Tiki(); + $parser->setRenderConf('xhtml', 'wikilink', 'exists_callback', array(&$pCommonObject, 'pageExists')); + $parser->setRenderConf('xhtml', 'wikilink', 'view_url', 'index.php?page='); + $parser->setRenderConf('xhtml', 'wikilink', 'new_url', 'edit.php?page='); + $parser->setRenderConf('xhtml', 'table', 'css_table', 'wikitable'); + $parser->setRenderConf('xhtml', 'table', 'css_td', 'wikicell'); + //$parser->setFormatConf('Xhtml', 'translate', false); + /*$extwiki = array(); + $extwikiSth = $this->query('SELECT `extwiki`, `name` FROM `tiki_extwiki`'); + while ($rec = $extwikiSth->fetchRow()) { + $extwiki[$rec['name']] = str_replace('$page', '%s', $rec['extwiki']); + } + $parser->setRenderConf('xhtml', 'interwiki', 'sites', $extwiki);*/ } + $xhtml = $parser->transform($pData, 'Xhtml'); + + global $gLibertySystem; + // create a table of contents for this page + // this function is called manually, since it processes the HTML code + /*if( preg_match( "/\{maketoc.*?\}/", $xhtml ) && @$gLibertySystem->mPlugins['datamaketoc']['is_active'] == 'y' ) { + $xhtml= data_maketoc($xhtml); + }*/ + return $xhtml; } ?> diff --git a/plugins/format.tikiwiki.php b/plugins/format.tikiwiki.php index 82c3822..8bd6ccc 100644 --- a/plugins/format.tikiwiki.php +++ b/plugins/format.tikiwiki.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * @package Liberty */ global $gLibertySystem; @@ -143,6 +143,7 @@ class TikiWikiParser extends BitBase { function storeLinks( &$pParamHash ) { + $links_already_inserted_table = array(); if( !empty( $pParamHash['content_id'] ) ) { $query = "DELETE FROM `".BIT_DB_PREFIX."tiki_links` WHERE `from_content_id`=?"; $result = $this->query( $query, array( $pParamHash['content_id'] ) ); @@ -156,8 +157,12 @@ class TikiWikiParser extends BitBase { $result = $this->query( $query, array( $page ) ); if( $result->numRows() ) { $res = $result->fetchRow(); - $query = "insert into `".BIT_DB_PREFIX."tiki_links`(`from_content_id`,`to_content_id`) values(?, ?)"; - $result = $this->query($query, array( $pParamHash['content_id'], $res['content_id'] ) ); + $key = $pParamHash['content_id'] . "-" . $res['content_id']; + if (empty($links_already_inserted_table[$key])) { + $query = "insert into `".BIT_DB_PREFIX."tiki_links`(`from_content_id`,`to_content_id`) values(?, ?)"; + $result = $this->query($query, array( $pParamHash['content_id'], $res['content_id'] ) ); + } + $links_already_inserted_table[$key] = 1; } } } diff --git a/templates/admin_liberty.tpl b/templates/admin_liberty.tpl index 5d26f56..7aa0444 100644 --- a/templates/admin_liberty.tpl +++ b/templates/admin_liberty.tpl @@ -19,13 +19,63 @@ {formlabel label="Acceptable HTML tags" for="approved_html_tags"} {formfeedback warning=$errors.warning} {forminput} - <input type="text" id="approved_html_tags" name="approved_html_tags" size="60" maxlength="250" value="{$approved_html_tags|escape}" /> + <input type="text" id="approved_html_tags" name="approved_html_tags" size="50" maxlength="250" value="{$approved_html_tags|escape}" /> {formhelp note="List of allowed HTML tags. All other tags will be stripped when users save content. This will affect all format plugins."} {/forminput} </div> {/legend} {/jstab} + {jstab title="Comment Settings"} + {legend legend="Comment Settings"} + {foreach from=$formCommentFeatures key=item item=output} + <div class="row"> + {formlabel label=`$output.label` for=$item} + {forminput} + {html_checkboxes name="$item" values="y" checked=`$gBitSystemPrefs.$item` labels=false id=$item} + {formhelp note=`$output.note` page=`$output.page`} + {/forminput} + </div> + {/foreach} + + <div class="row"> + {formlabel label="Comments per Page" for="comments_per_page"} + {forminput} + <select name="comments_per_page" id="comments_per_page"> + <option value="10" {if $gBitSystemPrefs.comments_per_page eq 10}selected="selected"{/if}>10</option> + <option value="20" {if $gBitSystemPrefs.comments_per_page eq 20}selected="selected"{/if}>20</option> + <option value="50" {if $gBitSystemPrefs.comments_per_page eq 50}selected="selected"{/if}>50</option> + <option value="100" {if $gBitSystemPrefs.comments_per_page eq 100}selected="selected"{/if}>100</option> + <option value="999999" {if $gBitSystemPrefs.comments_per_page eq 999999}selected="selected"{/if}>All</option> + </select> + {formhelp note="Default number of comments per page."} + {/forminput} + </div> + + <div class="row"> + {formlabel label="Default Sort Mode" for="comments_default_ordering"} + {forminput} + <select name="comments_default_ordering" id="comments_default_ordering"> + <option value="commentDate_desc" {if $gBitSystemPrefs.comments_default_ordering eq 'commentDate_desc'}selected="selected"{/if}>{tr}Newest first{/tr}</option> + <option value="commentDate_asc" {if $gBitSystemPrefs.comments_default_ordering eq 'commentDate_asc'}selected="selected"{/if}>{tr}Oldest first{/tr}</option> + {*<option value="points_desc" {if $gBitSystemPrefs.comments_default_ordering eq 'points_desc'}selected="selected"{/if}>{tr}Points{/tr}</option>*} + </select> + {formhelp note="Select the default sort mode for comments."} + {/forminput} + </div> + + <div class="row"> + {formlabel label="Comments default display mode" for="comments_default_display_mode"} + {forminput} + <select name="comments_default_display_mode" id="comments_default_display_mode"> + <option value="threaded" {if $gBitSystemPrefs.comments_default_display_mode eq 'threaded'}selected="selected"{/if}>{tr}Threaded{/tr}</option> + <option value="flat" {if $gBitSystemPrefs.comments_default_display_mode eq 'flat'}selected="selected"{/if}>{tr}Flat{/tr}</option> + </select> + {/forminput} + </div> + {/legend} + {/jstab} + {jstab title="Image Processing"} {legend legend="Image Processing System"} <input type="hidden" name="page" value="{$page}" /> @@ -65,6 +115,7 @@ {/legend} {/jstab} {/jstabs} + <div class="row submit"> <input type="submit" name="change_prefs" value="{tr}Change preferences{/tr}" /> </div> diff --git a/templates/admin_plugins.tpl b/templates/admin_plugins.tpl index b395ca4..02945cd 100644 --- a/templates/admin_plugins.tpl +++ b/templates/admin_plugins.tpl @@ -7,10 +7,61 @@ <h1>{tr}Admin Liberty Plugins{/tr}</h1> </div> + {debug} <div class="body"> {form legend="Liberty Plugins"} {formfeedback error=$errorMsg} + {jstabs} + {foreach from=$pluginTypes item=plugin_type key=plugin_type_label} + {jstab title="$plugin_type_label"} + {if $plugin_type eq 'format'} + {formfeedback warning="If you disable a format, content pages using that format can no longer be edited."} + {elseif $plugin_type eq 'data'} + {formfeedback warning="Disabling plugins will also disable them in content pages, even if they are already in use."} + {/if} + + <table class="panel"> + <caption>{tr}Plugin Type: {$plugin_type_label}{/tr}</caption> + <tr> + <th style="width:70%;">{tr}Plugin{/tr}</th> + <th style="width:20%;">{tr}GUID{/tr}</th> + {if $plugin_type eq 'format'} + <th style="width:5%;">{tr}Default{/tr}</th> + {/if} + <th style="width:5%;">{tr}Active{/tr}</th> + </tr> + + {foreach from=$gLibertySystem->mPlugins item=plugin key=guid} + {if $plugin.plugin_type eq $plugin_type} + <tr class="{cycle values="odd,even"}"> + <td> + {if $plugin_type eq 'data'} + <h3>{$plugin.title}</h3> + {/if} + <label for="{$guid}"> + {$plugin.plugin_description} + </label> + </td> + <td>{$guid}</td> + {if $plugin_type eq 'format'} + <td align="center">{if $plugin.is_active == 'y'}{html_radios values=$guid name="default_format" checked=$default_format}{/if}</td> + {/if} + <td align="center"> + {if $plugin.is_active=='x'} + Missing + {else} + {html_checkboxes name="PLUGINS[`$guid`]" values="y" checked=`$plugin.is_active` labels=false id=$guid} + {/if} + </td> + </tr> + {/if} + {/foreach} + </table> + {/jstab} + {/foreach} + {/jstabs} + {* {foreach from=$gLibertySystem->mPlugins item=plugin key=guid} {if $prev_type ne $plugin.plugin_type and $prev_type ne ''} </table><!-- close all but last table --> @@ -56,9 +107,7 @@ {/foreach} </table><!-- close last table --> - - {formfeedback warning="If you disable a format, wiki pages using that format can no longer be edited. Disabling plugins will also disable them in wiki pages, if they are already in use."} - +*} <div class="row submit"> <input type="submit" name="pluginsave" value="{tr}Save Plugin Settings{/tr}" /> </div> diff --git a/templates/comments.tpl b/templates/comments.tpl index fba694b..ef508d3 100644 --- a/templates/comments.tpl +++ b/templates/comments.tpl @@ -8,7 +8,7 @@ {/if} <h2> <a onclick="icntoggle('bitcomments');"> - {biticon ipackage=liberty iname="collapsed" id="bitcommentsimg" iexplain="folder"} {tr}Comments{/tr} + {biticon ipackage=liberty iname="collapsed" id="bitcommentsimg" iexplain=""} {tr}Comments{/tr} </a> </h2> </div> @@ -25,12 +25,6 @@ <div class="body"> {formfeedback hash=$formfeedback} - {section name=ix loop=$comments} - {displaycomment comment="$comments[ix]"} - {/section} - - {libertypagination hash=$commentsPgnHash} - {if $post_comment_preview} <h2>{tr}Comments Preview{/tr}</h2> <div class="preview"> @@ -39,6 +33,9 @@ {/if} {form action="`$comments_return_url`#editcomments"} + <input type="hidden" name="comments_maxComments" value="{$maxComments}" /> + <input type="hidden" name="comments_style" value="{$comments_style}" /> + <input type="hidden" name="comments_sort_mode" value="{$comments_sort_mode}" /> {if $post_comment_request || $post_comment_preview} <a name="editcomments"></a> {legend legend="Post Comment"} @@ -54,11 +51,11 @@ </div> {assign var=textarea_id value="commentpost"} - {if $gBitSystemPrefs.package_smileys eq 'y'} + {if $gBitSystem->isPackageActive( 'smileys' )} {include file="bitpackage:smileys/smileys_full.tpl"} {/if} - {if $gBitSystemPrefs.package_quicktags eq 'y'} + {if $gBitSystem->isPackageActive( 'quicktags' )} {include file="bitpackage:quicktags/quicktags_full.tpl" formId="commentpost"} {/if} @@ -81,8 +78,49 @@ </div> {/if} {/form} - </div><!-- end .body --> + {if $comments and $gBitSystem->isFeatureActive( 'comments_display_option_bar' )} + {form action="`$comments_return_url`#editcomments"} + <input type="hidden" name="post_comment_reply_id" value="{$post_comment_reply_id}" /> + <input type="hidden" name="post_comment_id" value="{$post_comment_id}" /> + <table class="optionbar"> + <tr> + <td> + <label for="comments-maxcomm">{tr}Messages{/tr} </label> + <select name="comments_maxComments" id="comments-maxcomm"> + <option value="10" {if $maxComments eq 10}selected="selected"{/if}>10</option> + <option value="20" {if $maxComments eq 20}selected="selected"{/if}>20</option> + <option value="50" {if $maxComments eq 50}selected="selected"{/if}>50</option> + <option value="100" {if $maxComments eq 100}selected="selected"{/if}>100</option> + <option value="999999" {if $maxComments eq 999999}selected="selected"{/if}>All</option> + </select> + </td> + <td> + <label for="comments-style">{tr}Style{/tr} </label> + <select name="comments_style" id="comments-style"> + <option value="flat" {if $comments_style eq "flat"}selected="selected"{/if}>Flat</option> + <option value="threaded" {if $comments_style eq "threaded"}selected="selected"{/if}>Threaded</option> + </select> + </td> + <td> + <label for="comments-sort">{tr}Sort{/tr} </label> + <select name="comments_sort_mode" id="comments-sort"> + <option value="commentDate_desc" {if $comments_sort_mode eq "commentDate_desc"}selected="selected"{/if}>Newest first</option> + <option value="commentDate_asc" {if $comments_sort_mode eq "commentDate_asc"}selected="selected"{/if}>Oldest first</option> + </select> + </td> + <td style="text-align:right"><input type="submit" name="comments_setOptions" value="set" /></td> + </tr> + </table> + {/form} + {/if} + + {section name=ix loop=$comments} + {displaycomment comment="$comments[ix]"} + {/section} + + {libertypagination hash=$commentsPgnHash} + </div><!-- end .body --> {/strip} <script type="text/javascript"> //<![CDATA[ diff --git a/templates/display_comment.tpl b/templates/display_comment.tpl index 1bf4d5c..aa9ea0c 100644 --- a/templates/display_comment.tpl +++ b/templates/display_comment.tpl @@ -1,9 +1,13 @@ {strip} -<div style="margin-left: {math equation="level * marginIncrement" level=$comment.level marginIncrement=20}px"> +{if $comments_style eq 'threaded'} + <div style="margin-left: {math equation="level * marginIncrement" level=$comment.level marginIncrement=20}px"> +{else} + <div style="margin-left: 0px"> +{/if} <div class="post"> <div class="floaticon"> - {if $gBitUser->hasPermission( 'bit_p_post_comment' )}<a href="{$comments_return_url}&post_comment_reply_id={$comment.content_id}&post_comment_request=1" rel="nofollow">{biticon ipackage="liberty" iname="reply" iexplain="Reply to this comment"}</a>{/if} - {if $gBitUser->isAdmin() || ($gBitUser && $comment.user_id == $gBitUser->mInfo.user_id)}<a href="{$comments_return_url}&post_comment_id={$comment.comment_id}&post_comment_request=1" rel="nofollow">{biticon ipackage="liberty" iname="edit" iexplain="Edit"}</a>{/if} + {if $gBitUser->hasPermission( 'bit_p_post_comment' )}<a href="{$comments_return_url}&post_comment_reply_id={$comment.content_id}&post_comment_request=1#editcomments" rel="nofollow">{biticon ipackage="liberty" iname="reply" iexplain="Reply to this comment"}</a>{/if} + {if $gBitUser->isAdmin() || ($gBitUser && $comment.user_id == $gBitUser->mInfo.user_id)}<a href="{$comments_return_url}&post_comment_id={$comment.comment_id}&post_comment_request=1#editcomments" rel="nofollow">{biticon ipackage="liberty" iname="edit" iexplain="Edit"}</a>{/if} {if $gBitUser->isAdmin()}<a href="{$comments_return_url}&delete_comment_id={$comment.comment_id}" rel="nofollow">{biticon ipackage="liberty" iname="delete" iexplain="Remove"}</a> {/if} </div> <h3>{$comment.title}</h3> @@ -11,6 +15,6 @@ <div class="content"> {$comment.parsed_data} </div> - </div><!-- end .commentpost --> + </div><!-- end .post --> </div><!-- end .left margin --> {/strip} diff --git a/templates/edit_help_inc.tpl b/templates/edit_help_inc.tpl index 911aec3..8d8fa80 100644 --- a/templates/edit_help_inc.tpl +++ b/templates/edit_help_inc.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_liberty/templates/edit_help_inc.tpl,v 1.2 2005/06/28 07:45:52 spiderr Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_liberty/templates/edit_help_inc.tpl,v 1.3 2005/07/17 17:36:11 squareing Exp $ *} {strip} {if $gBitSystem->isFeatureActive( 'feature_wikihelp' )} @@ -7,21 +7,21 @@ {foreach from=$formatplugins item=p} {if $p.is_active eq 'y'} {box title=`$p.name` class="help box"} - {if $p.help eq ''} - {tr}No description available{/tr} + {if $p.description eq ''} + {tr}There's no description available for {$p.name}{/tr} {else} - {$p.help} + {$p.description} {/if} {if $p.help_page} - <br />{tr}To view syntax help, please visit <a onkeypress="popUpWin(this.href,'standard',600,400);" onclick="popUpWin(this.href,'standard',600,400);return false;" class="external" href="http://www.bitweaver.org/wiki/index.php?page={$p.help_page}">{$p.help_page}</a>.{/tr} + <br />{tr}To view syntax help, please visit <a onkeypress="popUpWin(this.href,'full',800,800);" onclick="popUpWin(this.href,'full',800,800);return false;" class="external" href="http://www.bitweaver.org/wiki/index.php?page={$p.help_page}">{$p.help_page}</a>.{/tr} {/if} {/box} {/if} {/foreach} {box title="Syntax Help" class="help box"} - {tr}For more information, please visit <a class="external" href="http://www.bitweaver.org">bitweaver.org</a>{/tr} + {tr}For more information, please visit <a onkeypress="popUpWin(this.href,'full',800,800);" onclick="popUpWin(this.href,'full',800,800);return false;" class="external" href="http://www.bitweaver.org">bitweaver.org</a>{/tr} {/box} {/jstab} @@ -30,10 +30,10 @@ {foreach from=$dataplugins item=p} {if $p.is_active eq 'y'} {box title=`$p.name` class="help box"} - {if $p.help eq ''} - {tr}no description available{/tr} + {if $p.description eq ''} + {tr}There's no description available for the plugin {$p.name}{/tr} {else} - {$p.help} + {$p.description} {/if} {if $p.syntax} @@ -46,7 +46,7 @@ {/if} {if $p.help_page} - <br />{tr}for additional information about this plugin, see <a class="external" href="http://www.bitweaver.org/wiki/index.php?page={$p.help_page}">{$p.help_page}</a>.{/tr}<br/> + <br />{tr}for additional information about this plugin, see <a onkeypress="popUpWin(this.href,'full',800,800);" onclick="popUpWin(this.href,'full',800,800);return false;" class="external" href="http://www.bitweaver.org/wiki/index.php?page={$p.help_page}">{$p.help_page}</a>.{/tr}<br/> {/if} {/box} {/if} diff --git a/templates/edit_structure.tpl b/templates/edit_structure.tpl index 7012232..8a39b20 100644 --- a/templates/edit_structure.tpl +++ b/templates/edit_structure.tpl @@ -1,51 +1,10 @@ {strip} - {jstabs} - {jstab title="{tr}Edit{/tr} {tr}`$gStructure->mInfo.content_type.content_description`{/tr}"} - - {* - * before editing and committing this template, please make sure it is XHMTL standard compliant on W3C - * this file is a real *itch to fix if messed up - XING - *} - - <ul class="toc"> - <li> - {section name=ix loop=$subtree} - {if $subtree[ix].pos eq ''} - {if $structureInfo.structure_id eq $subtree[ix].structure_id}<div class="highlight">{/if} - {biticon iforce=icon ipackage=liberty iname="spacer" iexplain="" style="float:right"} - <a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}">{biticon iforce=icon ipackage=liberty iname="settings" iexplain="edit book" style="float:right"}</a> - <a href="{$gBitLoc.WIKI_PKG_URL}index.php?structure_id={$subtree[ix].structure_id}">{biticon iforce=icon ipackage=liberty iname="view" iexplain="view page" style="float:right"}</a> - - {$subtree[ix].title} {if $subtree[ix].page_alias}({/if}{$subtree[ix].page_alias}{if $subtree[ix].page_alias}){/if} - {biticon iforce=icon ipackage=liberty iname="spacer" iexplain=""} - {if $structureInfo.structure_id eq $subtree[ix].structure_id}</div>{/if} - {else} - {if $subtree[ix].first}<ul>{else}</li>{/if} - {if $subtree[ix].last}</ul>{else} - <li> - {if $structureInfo.structure_id eq $subtree[ix].structure_id}<div class="highlight">{/if} - <a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}&action=remove">{biticon iforce=icon ipackage=liberty iname="delete" iexplain="remove page" style="float:right"}</a> - <a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}&action=edit">{biticon iforce=icon ipackage=liberty iname="settings" iexplain="edit book" style="float:right"}</a> - <a href="{$gBitLoc.WIKI_PKG_URL}index.php?structure_id={$subtree[ix].structure_id}">{biticon iforce=icon ipackage=liberty iname="view" iexplain="view page" style="float:right"}</a> - {biticon iforce=icon ipackage=liberty iname="spacer" iexplain="" style="float:right"} - - <a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}&move_node=4">{biticon iforce=icon ipackage=liberty iname="nav_next" iexplain="move right" style="float:right"}</a> - <a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}&move_node=3">{biticon iforce=icon ipackage=liberty iname="nav_down" iexplain="move down" style="float:right"}</a> - <a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}&move_node=2">{biticon iforce=icon ipackage=liberty iname="nav_up" iexplain="move up" style="float:right"}</a> - <a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}&move_node=1">{biticon iforce=icon ipackage=liberty iname="nav_prev" iexplain="move left" style="float:right"}</a> - - <strong>{$subtree[ix].pos}</strong> {$subtree[ix].title}{if $subtree[ix].page_alias} ({$subtree[ix].page_alias}){/if} - {biticon iforce=icon ipackage=liberty iname="spacer" iexplain=""} - {if $structureInfo.structure_id eq $subtree[ix].structure_id}</div>{/if} - {/if} - {/if} - {/section} - </li> - </ul><!-- end outermost .toc --> + {jstab title="Edit Structure"} + {include file="bitpackage:liberty/edit_structure_inc.tpl"} {/jstab} - {jstab title="{tr}`$gStructure->mInfo.content_type.content_description`{/tr} {tr}Content{/tr}"} + {jstab title="Structure Content"} {include file="bitpackage:liberty/edit_structure_content.tpl"} {/jstab} diff --git a/templates/edit_structure_inc.tpl b/templates/edit_structure_inc.tpl new file mode 100644 index 0000000..a8ae2cf --- /dev/null +++ b/templates/edit_structure_inc.tpl @@ -0,0 +1,44 @@ +{strip} +<ul class="toc"> + <li> + {section name=ix loop=$subtree} + {if $subtree[ix].pos eq ''} + {if $structureInfo.structure_id eq $subtree[ix].structure_id}<div class="highlight">{/if} + {if !$hide_extended} + <div style="float:right;"> + <a href="{$gBitLoc.WIKI_PKG_URL}index.php?structure_id={$subtree[ix].structure_id}">{biticon iforce=icon ipackage=liberty iname="view" iexplain="view page"}</a> + <a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}">{biticon iforce=icon ipackage=liberty iname="settings" iexplain="edit book"}</a> + {biticon iforce=icon ipackage=liberty iname="spacer" iexplain=""} + </div> + {/if} + + {$subtree[ix].title} {if $subtree[ix].page_alias}({/if}{$subtree[ix].page_alias}{if $subtree[ix].page_alias}){/if} + {biticon iforce=icon ipackage=liberty iname="spacer" iexplain=""} + {if $structureInfo.structure_id eq $subtree[ix].structure_id}</div>{/if} + {else} + {if $subtree[ix].first}<ul>{else}</li>{/if} + {if $subtree[ix].last}</ul>{else} + <li> + {if $structureInfo.structure_id eq $subtree[ix].structure_id}<div class="highlight">{/if} + <div style="float:right;"> + <a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}&move_node=1">{biticon iforce=icon ipackage=liberty iname="nav_prev" iexplain="move left"}</a> + <a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}&move_node=2">{biticon iforce=icon ipackage=liberty iname="nav_up" iexplain="move up"}</a> + <a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}&move_node=3">{biticon iforce=icon ipackage=liberty iname="nav_down" iexplain="move down"}</a> + <a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}&move_node=4">{biticon iforce=icon ipackage=liberty iname="nav_next" iexplain="move right"}</a> + + {if !$hide_extended} + {biticon iforce=icon ipackage=liberty iname="spacer" iexplain=""} + <a href="{$gBitLoc.WIKI_PKG_URL}index.php?structure_id={$subtree[ix].structure_id}">{biticon iforce=icon ipackage=liberty iname="view" iexplain="view page"}</a> + <a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}&action=edit">{biticon iforce=icon ipackage=liberty iname="settings" iexplain="edit book"}</a> + <a href="{$PHP_SELF}?structure_id={$subtree[ix].structure_id}&action=remove">{biticon iforce=icon ipackage=liberty iname="delete" iexplain="remove page"}</a> + {/if} + </div> + <strong>{$subtree[ix].pos}</strong> {$subtree[ix].title}{if $subtree[ix].page_alias} ({$subtree[ix].page_alias}){/if} + {biticon iforce=icon ipackage=liberty iname="spacer" iexplain=""} + {if $structureInfo.structure_id eq $subtree[ix].structure_id}</div>{/if} + {/if} + {/if} + {/section} + </li> +</ul><!-- end outermost .toc --> +{/strip} diff --git a/templates/header_inc.tpl b/templates/header_inc.tpl new file mode 100644 index 0000000..3bda1f8 --- /dev/null +++ b/templates/header_inc.tpl @@ -0,0 +1,15 @@ +{* $Header: /cvsroot/bitweaver/_bit_liberty/templates/header_inc.tpl,v 1.2 2005/07/17 17:36:11 squareing Exp $ *} +{strip} +{if $structureInfo} + <link rel="index" title="{tr}Contents{/tr}" href="index.php?structure_id={$structureInfo.root_structure_id}" /> + {if $structureInfo.parent.structure_id} + <link rel="up" title="{tr}Up{/tr}" href="index.php?structure_id={$structureInfo.parent.structure_id}" /> + {/if} + {if $structureInfo.prev.structure_id} + <link rel="prev" title="{tr}Previous{/tr}" href="index.php?structure_id={$structureInfo.prev.structure_id}" /> + {/if} + {if $structureInfo.next.structure_id} + <link rel="next" title="{tr}Next{/tr}" href="index.php?structure_id={$structureInfo.next.structure_id}" /> + {/if} +{/if} +{/strip} diff --git a/templates/libertypagination.tpl b/templates/libertypagination.tpl index b3ffa53..5997322 100644 --- a/templates/libertypagination.tpl +++ b/templates/libertypagination.tpl @@ -16,12 +16,17 @@ <br /> - {if $gBitSystemPrefs.direct_pagination eq 'y'} + {if $gBitSystem->isFeatureActive( 'direct_pagination' )} {foreach from=$pgnPages item=link} {$link} {/foreach} {else} {form id="fPageSelect"} + + <input type="hidden" name="comments_maxComments" value="{$maxComments}" /> + <input type="hidden" name="comments_style" value="{$comments_style}" /> + <input type="hidden" name="comments_sort_mode" value="{$comments_sort_mode}" /> + <input type="hidden" name="find" value="{$find}" /> <input type="hidden" name="sort_mode" value="{$sort_mode}" /> {foreach from=$pgnHidden key=name item=value} diff --git a/templates/list_content_inc.tpl b/templates/list_content_inc.tpl index 90ac80b..3d8c763 100644 --- a/templates/list_content_inc.tpl +++ b/templates/list_content_inc.tpl @@ -1,5 +1,6 @@ {strip} {form legend="Select Content Type"} + <input type="hidden" name="user_id" value="{$user_id}" /> <div class="row"> {formlabel label="Restrict listing" for="content_type"} {forminput} @@ -25,16 +26,14 @@ <table class="data"> <caption>{tr}Available Content{/tr}</caption> <tr> -{* <th style="width:1px;white-space:nowrap;"><a href="{$gBitLoc.LIBERTY_PKG_URL}list_content.php?page={$page}&sort_mode={if $sort_mode eq 'content_id_asc'}content_id_desc{else}content_id_asc{/if}">{tr}Content ID{/tr}</a></th> *} - <th>{smartlink ititle="Title" isort=title page=$page idefault=1}</th> - <th>{smartlink ititle="Content Type" isort=content_type_guid page=$page}</th> + <th>{smartlink ititle="Title" isort=title page=$page user_id=$user_id idefault=1}</th> + <th>{smartlink ititle="Content Type" isort=content_type_guid page=$page user_id=$user_id}</th> <th>{tr}Author{/tr}</th> <th>{tr}Most Recent Editor{/tr}</th> <th> </th> </tr> {foreach from=$contentList item=item} <tr class="{cycle values='odd,even'}"> -{* <td style="text-align:right;">{$item.content_id} </td> *} <td>{$item.display_link}</td> <td>{assign var=content_type_guid value=`$item.content_type_guid`}{$contentTypes.$content_type_guid}</td> <td>{displayname real_name=$item.creator_real_name user=$item.creator_user}</td> @@ -44,5 +43,5 @@ {/foreach} </table> -{libertypagination numPages=$numPages page=$page sort_mode=$sort_mode content_type=$contentSelect user_id=$user_id} +{libertypagination numPages=$numPages page=$curPage sort_mode=$sort_mode content_type=$contentSelect user_id=$user_id} {/strip} |
