diff options
| author | Christian Fowler <spider@viovio.com> | 2005-10-12 15:13:53 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2005-10-12 15:13:53 +0000 |
| commit | 9718635bd1e7c963d534ded3c3a7241eb7462499 (patch) | |
| tree | 92f0fac7b23470aada1d2ab64a7c66536be37f6e | |
| parent | 41b8dd09e250dd3ea483e1fe94faf94be09af99d (diff) | |
| download | liberty-9718635bd1e7c963d534ded3c3a7241eb7462499.tar.gz liberty-9718635bd1e7c963d534ded3c3a7241eb7462499.tar.bz2 liberty-9718635bd1e7c963d534ded3c3a7241eb7462499.zip | |
merge recent changes to HEAD
| -rw-r--r-- | LibertyContent.php | 28 | ||||
| -rwxr-xr-x | LibertyStructure.php | 112 | ||||
| -rwxr-xr-x | LibertySystem.php | 9 | ||||
| -rw-r--r-- | admin/admin_liberty_inc.php | 19 | ||||
| -rw-r--r-- | admin/comments.php | 9 | ||||
| -rw-r--r-- | plugins/data.articles.php | 111 | ||||
| -rw-r--r-- | plugins/format.tikihtml.php | 6 | ||||
| -rw-r--r-- | plugins/format.tikiwiki.php | 18 | ||||
| -rw-r--r-- | templates/admin_liberty.tpl | 62 | ||||
| -rw-r--r-- | templates/attachment_browser.tpl | 6 | ||||
| -rw-r--r-- | templates/comments.tpl | 20 | ||||
| -rw-r--r-- | templates/display_comment.tpl | 2 | ||||
| -rw-r--r-- | templates/display_content.tpl | 4 | ||||
| -rw-r--r-- | templates/display_structure.tpl | 4 | ||||
| -rw-r--r-- | templates/edit_help_inc.tpl | 8 | ||||
| -rw-r--r-- | templates/edit_storage.tpl | 2 | ||||
| -rw-r--r-- | templates/edit_structure_content.tpl | 2 |
17 files changed, 228 insertions, 194 deletions
diff --git a/LibertyContent.php b/LibertyContent.php index 0360247..4b69627 100644 --- a/LibertyContent.php +++ b/LibertyContent.php @@ -3,7 +3,7 @@ * Management of Liberty content * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.9 2005/08/30 22:25:07 squareing Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.10 2005/10/12 15:13:52 spiderr Exp $ * @author spider <spider@steelsun.com> */ @@ -68,6 +68,11 @@ class LibertyContent extends LibertyBase { * @public */ var $mPerms; + /** + * Admin control permission specific to this LibertyContent type + * @private + */ + var $mAdminContentPerm; /** * Construct an empty LibertyBase object with a blank permissions array @@ -75,6 +80,9 @@ class LibertyContent extends LibertyBase { function LibertyContent () { LibertyBase::LibertyBase(); $this->mPerms = array(); + if( empty( $this->mAdminContentPerm ) ) { + $this->mAdminContentPerm = 'bit_p_admin_content'; + } } /** @@ -212,6 +220,9 @@ class LibertyContent extends LibertyBase { if( empty( $pParamHash['content_id'] ) ) { $pParamHash['content_store']['content_id'] = $this->mDb->GenID( 'tiki_content_id_seq' ); $pParamHash['content_id'] = $pParamHash['content_store']['content_id']; + // make sure some variables are stuff in case services need getObjectType, mContentId, etc... + $this->mInfo['content_type_guid'] = $pParamHash['content_type_guid']; + $this->mContentId = $pParamHash['content_store']['content_id']; $result = $this->mDb->associateInsert( $table, $pParamHash['content_store'] ); } else { if( !empty( $pParamHash['content_store']['title'] ) && !empty( $this->mInfo['title'] ) ) { @@ -406,7 +417,7 @@ class LibertyContent extends LibertyBase { function hasUserPermission( $pPermName, $pFatalIfFalse=FALSE, $pFatalMessage=NULL ) { global $gBitUser; if( !$gBitUser->isRegistered() || !($ret = $this->isOwner()) ) { - if( !($ret = $gBitUser->isAdmin()) ) { + if( !($ret = $this->hasAdminPermission()) ) { $this->verifyAccessControl(); if( $this->loadPermissions() ) { $userPerms = $this->getUserPermissions( $gBitUser->mUserId ); @@ -420,6 +431,17 @@ class LibertyContent extends LibertyBase { } /** + * Determine if current user has the ability to administer this type of content + * + * @return bool True if user has this type of content administration permission + */ + function hasAdminPermission() { + global $gBitUser; + return( $gBitUser->isAdmin() || $gBitUser->hasPermission( $this->mAdminContentPerm ) ); + } + + + /** * Get specific permissions for the specified user for this content * * @param integer Id of user for whom permissions are to be loaded @@ -879,7 +901,7 @@ class LibertyContent extends LibertyBase { require_once $gBitSmarty->_get_plugin_filepath( 'modifier', 'bit_long_date' ); $aux['display_link'] = $type['content_object']->getDisplayLink( $aux['title'], $aux ); // getDisplayUrl is currently a pure virtual method in LibertyContent, so this cannot be called currently -// $aux['display_url'] = $type['content_object']->getDisplayUrl( $aux['title'], $aux ); +// $aux['display_url'] = $type['content_object']->getDisplayUrl( $aux['title'], $aux ); $aux['title'] = $type['content_object']->getTitle( $aux ); $ret[] = $aux; } diff --git a/LibertyStructure.php b/LibertyStructure.php index b9027f6..658422d 100755 --- a/LibertyStructure.php +++ b/LibertyStructure.php @@ -3,7 +3,7 @@ * Management of Liberty Content * * @package liberty - * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyStructure.php,v 1.7 2005/08/30 22:25:07 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyStructure.php,v 1.8 2005/10/12 15:13:52 spiderr Exp $ * @author spider <spider@steelsun.com> */ @@ -40,9 +40,14 @@ class LibertyStructure extends LibertyBase { } function getNode( $pStructureId=NULL, $pContentId=NULL ) { + global $gLibertySystem, $gBitSystem; + $contentTypes = $gLibertySystem->mContentTypes; $ret = NULL; - $query = 'SELECT ts.*,tc.`title`, tc.`content_type_guid`, tc.`user_id` - FROM `'.BIT_DB_PREFIX.'tiki_structures` ts INNER JOIN `'.BIT_DB_PREFIX.'tiki_content` tc ON (ts.`content_id`=tc.`content_id`)'; + $query = 'SELECT ts.*, tc.`user_id`, tc.`title`, tc.`content_type_guid`, uu.`login`, uu.`real_name` + FROM `'.BIT_DB_PREFIX.'tiki_structures` ts + INNER JOIN `'.BIT_DB_PREFIX.'tiki_content` tc ON (ts.`content_id`=tc.`content_id`) + LEFT JOIN `'.BIT_DB_PREFIX.'users_users` uu ON ( uu.`user_id` = tc.`user_id` )'; + if( is_numeric( $pStructureId ) ) { $query .= ' WHERE ts.`structure_id`=?'; $bindVars = array( $pStructureId ); @@ -50,9 +55,22 @@ class LibertyStructure extends LibertyBase { $query .= ' WHERE ts.`content_id`=?'; $bindVars = array( $pContentId ); } + if( $result = $this->mDb->query( $query, $bindVars ) ) { $ret = $result->fields; } + + if( !empty( $contentTypes[$ret['content_type_guid']] ) ) { + // quick alias for code readability + $type = &$contentTypes[$ret['content_type_guid']]; + if( empty( $type['content_object'] ) ) { + // create *one* object for each object *type* to call virtual methods. + include_once( $gBitSystem->mPackages[$type['handler_package']]['path'].$type['handler_file'] ); + $type['content_object'] = new $type['handler_class'](); + } + $ret['title'] = $type['content_object']->getTitle( $ret ); + } + return $ret; } @@ -129,6 +147,7 @@ class LibertyStructure extends LibertyBase { function getSubTree( $pStructureId, $level = 0, $parent_pos = '' ) { + global $gLibertySystem, $gBitSystem; if( !empty( $pStructureId ) ) { $ret = array(); $pos = 1; @@ -147,40 +166,52 @@ class LibertyStructure extends LibertyBase { } //Get all child nodes for this structure_id - $query = "SELECT ts.`content_id`, ts.`structure_id`, ts.`page_alias`, tc.`title` - FROM `".BIT_DB_PREFIX."tiki_structures` ts, `".BIT_DB_PREFIX."tiki_content` tc - WHERE tc.`content_id` = ts.`content_id` AND `parent_id`=? ORDER BY `pos` asc"; + $query = "SELECT ts.`content_id`, ts.`structure_id`, ts.`page_alias`, tc.`user_id`, tc.`title`, tc.`content_type_guid`, uu.`login`, uu.`real_name` + FROM `".BIT_DB_PREFIX."tiki_structures` ts, `".BIT_DB_PREFIX."tiki_content` tc + LEFT JOIN `".BIT_DB_PREFIX."users_users` uu ON ( uu.`user_id` = tc.`user_id` ) + WHERE tc.`content_id` = ts.`content_id` AND `parent_id`=? ORDER BY `pos` asc"; $result = $this->mDb->query($query,array( $pStructureId ) ); $subs = array(); $row_max = $result->numRows(); + $contentTypes = $gLibertySystem->mContentTypes; while ($res = $result->fetchRow()) { - //Add + $aux = array(); $aux = $res; - $aux["first"] = ($pos == 1); - $aux["last"] = false; - $aux["level"] = $level; - if (strlen($parent_pos) == 0) { - $aux["pos"] = "$pos"; - } - else { - $aux["pos"] = $parent_pos . '.' . "$pos"; - } - $ret[] = $aux; - - //Recursively add any child nodes - $subs = $this->getSubTree($res["structure_id"], ($level + 1), $aux["pos"]); - if(isset($subs)) { - $ret = array_merge($ret, $subs); - } - // Insert a dummy entry to close table/list - if ($pos == $row_max) { - $aux["first"] = false; - $aux["last"] = true; + if( !empty( $contentTypes[$res['content_type_guid']] ) ) { + // quick alias for code readability + $type = &$contentTypes[$res['content_type_guid']]; + if( empty( $type['content_object'] ) ) { + // create *one* object for each object *type* to call virtual methods. + include_once( $gBitSystem->mPackages[$type['handler_package']]['path'].$type['handler_file'] ); + $type['content_object'] = new $type['handler_class'](); + } + $aux['title'] = $type['content_object']->getTitle( $aux ); + $aux["first"] = ($pos == 1); + $aux["last"] = false; + $aux["level"] = $level; + if (strlen($parent_pos) == 0) { + $aux["pos"] = "$pos"; + } + else { + $aux["pos"] = $parent_pos . '.' . "$pos"; + } $ret[] = $aux; - } - $pos++; + //Recursively add any child nodes + $subs = $this->getSubTree($res["structure_id"], ($level + 1), $aux["pos"]); + if(isset($subs)) { + $ret = array_merge($ret, $subs); + } + // Insert a dummy entry to close table/list + if ($pos == $row_max) { + $aux["first"] = false; + $aux["last"] = true; + $ret[] = $aux; + } + + $pos++; + } } } return $ret; @@ -542,23 +573,36 @@ class LibertyStructure extends LibertyBase { // it's used only in {toc} thing hardcoded in parse gBitSystem->parse -- (mose) // the $tocPrefix can be used to Prefix a subtree as it would start from a given number (e.g. 2.1.3) function build_subtree_toc($id,$slide=false,$order='asc',$tocPrefix='') { + global $gLibertySystem, $gBitSystem; $back = array(); $cant = $this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_structures` where `parent_id`=?",array((int)$id)); if ($cant) { - $query = "SELECT `structure_id`, tc.`title`, `page_alias` + $query = "SELECT `structure_id`, `page_alias`, tc.`user_id`, tc.`title`, tc.`content_type_guid`, uu.`login`, uu.`real_name` FROM `".BIT_DB_PREFIX."tiki_structures` ts INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON ( tc.`content_id`=ts.`content_id` ) + LEFT JOIN `".BIT_DB_PREFIX."users_users` uu ON ( uu.`user_id` = tc.`user_id` ) WHERE `parent_id`=? ORDER BY ".$this->mDb->convert_sortmode("pos_".$order); $result = $this->mDb->query($query,array((int)$id)); $prefix=1; + $contentTypes = $gLibertySystem->mContentTypes; while ($res = $result->fetchRow()) { $res['prefix']=($tocPrefix=='')?'':"$tocPrefix."; $res['prefix'].=$prefix; $prefix++; - if ($res['structure_id'] != $id) { - $sub = $this->build_subtree_toc($res['structure_id'],$slide,$order,$res['prefix']); - if (is_array($sub)) { - $res['sub'] = $sub; + if( !empty( $contentTypes[$res['content_type_guid']] ) ) { + // quick alias for code readability + $type = &$contentTypes[$res['content_type_guid']]; + if( empty( $type['content_object'] ) ) { + // create *one* object for each object *type* to call virtual methods. + include_once( $gBitSystem->mPackages[$type['handler_package']]['path'].$type['handler_file'] ); + $type['content_object'] = new $type['handler_class'](); + } + $res['title'] = $type['content_object']->getTitle( $res ); + if ($res['structure_id'] != $id) { + $sub = $this->build_subtree_toc($res['structure_id'],$slide,$order,$res['prefix']); + if (is_array($sub)) { + $res['sub'] = $sub; + } } } $back[] = $res; diff --git a/LibertySystem.php b/LibertySystem.php index 28e18d2..176647b 100755 --- a/LibertySystem.php +++ b/LibertySystem.php @@ -3,7 +3,7 @@ * System class for handling the liberty package * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.7 2005/08/30 22:25:07 squareing Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.8 2005/10/12 15:13:52 spiderr Exp $ * @author spider <spider@steelsun.com> */ @@ -125,6 +125,11 @@ class LibertySystem extends LibertyBase { } } + function getService( $pPackageName ) { + global $gBitSystem; + return $gBitSystem->mPackages[$pPackageName]['service']; + } + function registerService( $pServiceName, $pPackageName, $pServiceHash ) { $this->mServices[$pServiceName][$pPackageName] = $pServiceHash; } @@ -233,8 +238,6 @@ class LibertySystem extends LibertyBase { return $ret; } - - } function parse_data_plugins(&$data, &$preparsed, &$noparsed, &$pParser ) { diff --git a/admin/admin_liberty_inc.php b/admin/admin_liberty_inc.php index 0bedf0b..7fd749c 100644 --- a/admin/admin_liberty_inc.php +++ b/admin/admin_liberty_inc.php @@ -14,25 +14,6 @@ $formLibertyFeatures = array( $gBitSmarty->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' => '', - ), - "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' => '', - ), - "comments_display_expanded" => array( - 'label' => 'Expand Comments', - 'note' => 'When users first visit your site, comments can be hidden or displayed by default.', - 'page' => '', - ), -); -$gBitSmarty->assign( 'formCommentFeatures', $formCommentFeatures ); - $formImageFeatures = array( "liberty_jpeg_originals" => array( diff --git a/admin/comments.php b/admin/comments.php index 3583ed5..cbc087d 100644 --- a/admin/comments.php +++ b/admin/comments.php @@ -24,9 +24,18 @@ $commentSettings = array( $gBitSmarty->assign( 'commentSettings', $commentSettings ); if( !empty( $_REQUEST['change_prefs'] ) ) { + + foreach( array_keys( $commentSettings ) as $item ) { simple_set_toggle( $item ); } + + $formValues = array('comments_per_page', 'comments_default_ordering', 'comments_default_display_mode' ); + foreach( $formValues as $item ) { + simple_set_value( $item ); + } + + } $gBitSystem->display( 'bitpackage:liberty/admin_comments.tpl'); diff --git a/plugins/data.articles.php b/plugins/data.articles.php index 22fed53..a98b02f 100644 --- a/plugins/data.articles.php +++ b/plugins/data.articles.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ * @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.6 2005/08/30 22:25:07 squareing Exp $ +// $Id: data.articles.php,v 1.7 2005/10/12 15:13:52 spiderr Exp $ /** * definitions @@ -31,8 +31,8 @@ $pluginParams = array ( 'tag' => 'ARTICLES', 'auto_activate' => FALSE, 'requires_pair' => FALSE, 'load_function' => 'data_articles', - 'title' => 'Articles<strong> - This plugin is not yet functional.</strong>', // Remove this line when the plugin becomes operational -// 'title' => 'Articles', // and Remove the comment from the start of this line +// 'title' => 'Articles<strong> - This plugin is not yet functional.</strong>', // Remove this line when the plugin becomes operational + 'title' => 'Articles', // and Remove the comment from the start of this line 'help_page' => 'DataPluginArticles', 'description' => tra("This plugin will display several Articles."), 'help_function' => 'data_articles_help', @@ -66,6 +66,11 @@ function data_articles_help() { .'<td>' . tra( "type name") . '<br />' . tra("(optional)") . '</td>' .'<td>' . tra( "Filters the Articles so that only the Type specified is displayed") . '</td>' .'</tr>' + .'<tr class="even">' + .'<td>format</td>' + .'<td>' . tra( "display format") . '<br />' . tra("(optional)") . '</td>' + .'<td>' . tra( "Specify format for article display - default is simple title list") . '</td>' + .'</tr>' .'</table>' . tra("Example: ") . "{ARTICLES max=5 topic='some_topic'}<br />" . tra("Example: ") . "{ARTICLES max=5 type='some_type'}"; @@ -77,50 +82,66 @@ function data_articles($data, $params) { // No change in the parameters with Cly // The next 2 lines allow access to the $pluginParams given above and may be removed when no longer needed global $gLibertySystem; $pluginParams = $gLibertySystem->mPlugins[PLUGIN_GUID_DATAARTICLES]; - $ret = 'The plugin <strong>"' . $pluginParams['tag'] . '"</strong> has not been completed as yet. '; - return $ret; -} -} -/****************************************************************************** -The code below is from the deprecated ARTICLES plugin. All comments and the help routines have been removed. - StarRider + require_once( ARTICLES_PKG_PATH.'BitArticle.php'); + require_once( LIBERTY_PKG_PATH.'lookup_content_inc.php' ); + $module_params = $params; + + $articles = new BitArticle(); + $stati = array( 'pending', 'approved' ); + if( !empty( $module_params['status'] ) && in_array( $module_params['status'], $stati ) ) { + $status_id = constant( 'ARTICLE_STATUS_'.strtoupper( $module_params['status'] ) ); + } else { + $status_id = ARTICLE_STATUS_APPROVED; + } -global $gBitSystem; -if( $gBitSystem->isPackageActive( 'articles' ) ) { - include_once( ARTICLES_PKG_PATH . 'art_lib.php' ); - - function wikiplugin_articles($data,$params) { - global $gBitSmarty; - global $gBitSystem; - global $artlib; - global $feature_articles; - global $bit_p_read_article; - global $user; - extract($params); - if (($feature_articles != 'y') || (!$gBitUser->hasPermission( 'bit_p_read_article' ))) { - // the feature is disabled or the user can't read articles - return(""); - } - if(!isset($max)) {$max='3';} - // Addes filtering by topic if topic is passed - if(!isset($topic)) { - $topic=''; - } else { - $topic = $artlib->get_topic_id($topic); - } - $now = $gBitSystem->getUTCTime(); - $listpages = $artlib->list_articles(0, $max, 'publish_date_desc', '', $now, $user, '', $topic); - for ($i = 0; $i < count($listpages["data"]); $i++) { - $listpages["data"][$i]["parsed_heading"] = $artlib->parseData($listpages["data"][$i]["heading"]); - //print_r($listpages["data"][$i]['title']); - } - $topics = $artlib->list_topics(); - $gBitSmarty->assign_by_ref('topics', $topics); - // If there're more records then assign next_offset - $gBitSmarty->assign_by_ref('listpages', $listpages["data"]); - return "~np~ ".$gBitSmarty->fetch('bitpackage:articles/center_list_articles.tpl')." ~/np~"; + $sortOptions = array( + "last_modified_asc", + "last_modified_desc", + "created_asc", + "created_desc", + ); + if( !empty( $module_params['sort_mode'] ) && in_array( $module_params['sort_mode'], $sortOptions ) ) { + $sort_mode = $module_params['sort_mode']; + } else { + $sort_mode = 'last_modified_desc'; } + + $getHash = Array(); + $getHash['status_id'] = $status_id; + $getHash['sort_mode'] = $sort_mode; + $getHash['max_records'] = empty($module_params['max']) ? 1 : $module_params['max']; + $getHash['topic'] = !empty( $module_params['topic'] ) ? $module_params['topic'] : NULL; + $articles_results = $articles->getList( $getHash ); + + + $display_format = empty($module_params['format']) ? 'simple_title_list' : $module_params['format']; + $display_result = ""; + + switch ($display_format) { + + case 'simple_title_list': + default: + $display_result = "<table><tr><td>"; + foreach ($articles_results['data'] as $article) { + $article_object = new BitArticle($article['article_id']); + $link = "" + . "<a href='" + . $article_object->getDisplayUrl() + . "'>" + . $article['title'] + . "</a>" + ; + + $display_result .= "<tr><td>$link</td></tr>\n"; + } + $display_result .= "</table>\n"; + break; + + } + + return $display_result; +} } -*/ ?> diff --git a/plugins/format.tikihtml.php b/plugins/format.tikihtml.php index 8b57960..64f6c7c 100644 --- a/plugins/format.tikihtml.php +++ b/plugins/format.tikihtml.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * @package liberty * @subpackage plugins_format */ @@ -35,7 +35,9 @@ function purge_html( $pText ) { // convert all HTML entites to catch people trying to sneak stuff by with things like { etc.. if( function_exists( 'html_entity_decode' ) ) { - $text = html_entity_decode( $pText ); + // quieten this down since it causes an error in PHP4 + // http://bugs.php.net/bug.php?id=25670 + $text = @html_entity_decode( $pText, ENT_COMPAT, 'UTF-8' ); } else { $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); diff --git a/plugins/format.tikiwiki.php b/plugins/format.tikiwiki.php index cec33e6..4f6964a 100644 --- a/plugins/format.tikiwiki.php +++ b/plugins/format.tikiwiki.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ * @package liberty */ global $gLibertySystem; @@ -81,7 +81,7 @@ function tikiwiki_parse_data( &$pData, &$pCommonObject ) { } /** - * TikiWikiParser + * TikiWikiParser * * @package kernel */ @@ -144,6 +144,9 @@ class TikiWikiParser extends BitBase { function storeLinks( &$pParamHash ) { + global $gBitSystem; + if (!$gBitSystem->isPackageActive( 'wiki') ) + return; $links_already_inserted_table = array(); if( !empty( $pParamHash['content_id'] ) ) { $query = "DELETE FROM `".BIT_DB_PREFIX."tiki_links` WHERE `from_content_id`=?"; @@ -502,10 +505,8 @@ $this->debug(0); global $gBitSystem; global $gBitUser; global $page; - global $wikilib; - if( empty( $wikilib ) ) { + if( $gBitSystem->isPackageActive( 'wiki' ) ) { require_once( WIKI_PKG_PATH.'BitPage.php' ); - global $wikilib; } if( $gBitSystem->isFeatureActive( 'allow_html' ) ) { @@ -753,7 +754,6 @@ $this->debug(0); // New syntax for wiki pages ((name)) Where name can be anything preg_match_all("/\(\(([^\)][^\)]+)\)\)/", $data, $pages); - foreach (array_unique($pages[1])as $page_parse) { $repl2 = true; @@ -795,7 +795,7 @@ $this->debug(0); // If they are parenthesized then don't treat as links // Prevent ))PageName(( from being expanded \"\' //[A-Z][a-z0-9_\-]+[A-Z][a-z0-9_\-]+[A-Za-z0-9\-_]* - if ($gBitSystem->getPreference('feature_wikiwords') == 'y') { + if( $gBitSystem->isPackageActive( 'wiki' ) && $gBitSystem->isFeatureActive( 'feature_wikiwords' ) ) { // The first part is now mandatory to prevent [Foo|MyPage] from being converted! // the {2} is curious but seems to prevent things like "__Administration / Modules__" getting linked - spiderr $pages = $this->extractWikiWords( $data ); @@ -873,7 +873,7 @@ $this->debug(0); //print_r($imgdata); $repl = '<img alt="' . tra('Image') . '" src="'.$imgdata["src"].'" style="border:0;'.( !empty( $imgdata["float"] ) ? ' float:'.$imgdata["float"].';' : '' ).'"'; - + if ($imgdata["width"]) $repl .= ' width="' . $imgdata["width"] . '"'; @@ -1334,7 +1334,7 @@ $this->debug(0); } foreach ($preparsed as $pp) { -// $data = str_replace($pp["key"], "<pre>" . $pp["data"] . "</pre>", $data); + $data = str_replace($pp["key"], "<pre>" . $pp["data"] . "</pre>", $data); } // Process pos_handlers here diff --git a/templates/admin_liberty.tpl b/templates/admin_liberty.tpl index 0c33ea8..07fcb5d 100644 --- a/templates/admin_liberty.tpl +++ b/templates/admin_liberty.tpl @@ -26,60 +26,13 @@ {/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}" /> {php}if( extension_loaded( 'gd' ) ) {{/php}{assign var=gdInstalled value=TRUE}{php}}{/php} + {if !$gdInstalled} + {formfeedback warning='The GD library is not installed. For newer Linux systems (Fedora, etc.), you need to install the php-gd RPM with a command such as "yum install php-gd".'} + {/if} <div class="row"> {formlabel label=" <a href='http://www.boutell.com/gd/'> @@ -90,13 +43,13 @@ <label> <input type="radio" name="image_processor" value="gd" {if !$gdInstalled}disabled="disabled"{/if} {if !$gBitSystemPrefs.image_processor || $gBitSystemPrefs.image_processor=='gd'}checked="checked"{/if} /> gdLibrary </label> - {if !$gdInstalled} - {formfeedback warning='The GD library is not installed. For newer Linux systems (Fedora, etc.), you need to install the php-gd RPM with a command such as "yum install php-gd".'} - {/if} {/forminput} </div> {php}if( extension_loaded( 'imagick' ) ) {{/php}{assign var=imagickInstalled value=TRUE}{php}}{/php} + {if !$imagickInstalled} + {formfeedback warning='To use <a href="http://www.imagemagick.org/www/download.html">ImageMagick</a>, you need to install the php-imagick extension. For Linux users, RPM files can be found at <a href="http://phprpms.sourceforge.net/imagick">PHPRPMs</a> (or compile a <a href="http://sourceforge.net/project/showfiles.php?group_id=112092&package_id=139307&release_id=292417">source rpm</a>). Windows users can try <a href="http://www.bitweaver.org/builds/php_imagick.dll">this dll</a> however it has not been tested well.'} + {/if} <div class="row"> {formlabel label=" <a href='http://www.imagemagick.org/'> @@ -107,9 +60,6 @@ <label> <input type="radio" name="image_processor" value="imagick" {if !$imagickInstalled}disabled="disabled"{/if} {if $gBitSystemPrefs.image_processor=='imagick'}checked="checked"{/if}/> ImageMagick </label> - {if !$imagickInstalled} - {formfeedback warning='To use <a href="http://www.imagemagick.org/www/download.html">ImageMagick</a>, you need to install the php-imagick extension. For Linux users, RPM files can be found at <a href="http://phprpms.sourceforge.net/imagick">PHPRPMs</a> (or compile a <a href="http://sourceforge.net/project/showfiles.php?group_id=112092&package_id=139307&release_id=292417">source rpm</a>). Windows users can try <a href="http://www.bitweaver.org/builds/php_imagick.dll">this dll</a> however it has not been tested well.'} - {/if} {/forminput} </div> {foreach from=$formImageFeatures key=item item=output} diff --git a/templates/attachment_browser.tpl b/templates/attachment_browser.tpl index d44dd2a..43716ac 100644 --- a/templates/attachment_browser.tpl +++ b/templates/attachment_browser.tpl @@ -16,12 +16,6 @@ <link rel="alternate stylesheet" title="{$alt_name}" type="text/css" href="{$alt_path}" media="screen" /> {/foreach} - <script type="text/javascript"><!-- - var tikiCookiePath = "{$gBitSystemPrefs.cookie_path}"; - var tikiCookieDomain = "{$gBitSystemPrefs.cookie_domain}"; - var tikiIconDir = "{$smarty.const.LIBERTY_PKG_URL}icons"; - var tikiRootUrl = "{$smarty.const.BIT_ROOT_URL}"; - --></script> <script type="text/javascript" src="{$smarty.const.KERNEL_PKG_URL}bitweaver.js"></script> {literal} diff --git a/templates/comments.tpl b/templates/comments.tpl index d4dc670..d7b8ee3 100644 --- a/templates/comments.tpl +++ b/templates/comments.tpl @@ -1,9 +1,13 @@ {strip} <br /> -{if $gBitSystem->isFeatureActive( 'comments_display_expanded' )} - {assign var=initial value=none}{assign var=subsequent value=block}{assign var=iname value=expanded} +{if $gBitSystemPrefs.comments_display_expanded eq 'y'} + {assign var=initial value=block} + {assign var=iname value=expanded} + {* iname=expanded displays a minus sign *} {else} - {assign var=initial value=block}{assign var=subsequent value=none}{assign var=iname value=collapsed} + {assign var=initial value=none} + {assign var=iname value=collapsed} + {* iname=collapsed displays a plus sign *} {/if} @@ -19,10 +23,16 @@ </h2> </div> +{* +$smarty.cookies.bitcomments is only set if user has clicked on the +/- icon to expand/collapse the comment +display. Cookie values are: o=display is expanded, c=display is collapased +If cookie is not set, then use $gBitSystemPrefs.comments_display_expanded to determine the display +*} + {/strip} <script type="text/javascript">//<![CDATA[ setfoldericonstate('bitcomments'); - document.write('<div id="bitcomments" style="display:{if $smarty.cookies.bitcomments eq 'o'}{$initial}{else}{$subsequent}{/if};">'); + document.write('<div id="bitcomments" style="display:{if $smarty.cookies.bitcomments eq 'o'}block{else}{if $smarty.cookies.bitcomments eq 'c'}none{else}{$initial}{/if}{/if};">'); //]]></script> {strip} @@ -83,7 +93,7 @@ {/if} {/form} - {if $comments and $gBitSystem->isFeatureActive( 'comments_display_option_bar' )} + {if $comments and $gBitSystemPrefs.comments_display_option_bar eq 'y'} {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}" /> diff --git a/templates/display_comment.tpl b/templates/display_comment.tpl index aa9ea0c..d331474 100644 --- a/templates/display_comment.tpl +++ b/templates/display_comment.tpl @@ -6,7 +6,7 @@ {/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#editcomments" rel="nofollow">{biticon ipackage="liberty" iname="reply" iexplain="Reply to this comment"}</a>{/if} + {if $gBitUser->hasPermission( 'bit_p_post_comments' )}<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> diff --git a/templates/display_content.tpl b/templates/display_content.tpl index 318f321..ac74793 100644 --- a/templates/display_content.tpl +++ b/templates/display_content.tpl @@ -1,5 +1,3 @@ -{include file="bitpackage:liberty/display_structure.tpl"} - Generic Content display template. - +<br /> Title: {$pageInfo.title} diff --git a/templates/display_structure.tpl b/templates/display_structure.tpl index 6c83603..d5137f9 100644 --- a/templates/display_structure.tpl +++ b/templates/display_structure.tpl @@ -18,7 +18,7 @@ {if $structureInfo.prev and $structureInfo.prev.structure_id} <a href="index.php?structure_id={$structureInfo.prev.structure_id}"> {if $wikibook_use_icons eq 'y'} - {biticon ipackage=liberty iname=nav_prev iexplain=previous} + {biticon ipackage=liberty iname=nav_prev iexplain=Previous} {else} « {$structureInfo.prev.title} {/if} @@ -30,7 +30,7 @@ {if $structureInfo.next and $structureInfo.next.structure_id} <a href="index.php?structure_id={$structureInfo.next.structure_id}"> {if $wikibook_use_icons eq 'y'} - {biticon ipackage=liberty iname=nav_next iexplain=previous} + {biticon ipackage=liberty iname=nav_next iexplain=Next} {else} {$structureInfo.next.title} » {/if} diff --git a/templates/edit_help_inc.tpl b/templates/edit_help_inc.tpl index 1a9d602..88b0171 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.5 2005/08/24 20:55:17 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_liberty/templates/edit_help_inc.tpl,v 1.6 2005/10/12 15:13:53 spiderr Exp $ *} {strip} {if $gBitSystem->isFeatureActive( 'feature_wikihelp' )} @@ -14,14 +14,14 @@ {/if} {if $p.help_page} - <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} + <br />{tr}To view syntax help, please visit {jspopup href="http://www.bitweaver.org/wiki/index.php?page=`$p.help_page`" title=$p.help_page class=external}.{/tr} {/if} {/box} {/if} {/foreach} {box title="Syntax Help" class="help box"} - {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} + {tr}For more information, please visit {jspopup href="http://www.bitweaver.org/" title="www.bitweaver.org" class=external}{/tr} {/box} {/jstab} @@ -46,7 +46,7 @@ {/if} {if $p.help_page} - <br />{tr}for additional information about this plugin, see <a title="This link will open a new window" 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/> + <br />{tr}for additional information about this plugin, see {jspopup href="http://www.bitweaver.org/wiki/index.php?page=`$p.help_page`" type=fullscreen title=$p.help_page class=external}.{/tr}<br/> {/if} {/box} {/if} diff --git a/templates/edit_storage.tpl b/templates/edit_storage.tpl index f31b435..2dcf1ee 100644 --- a/templates/edit_storage.tpl +++ b/templates/edit_storage.tpl @@ -20,7 +20,7 @@ include (LIBERTY_PKG_PATH."edit_storage_inc.php"); {formlabel label="Existing Attachment ID"} {forminput} <input type="text" name="existing_attachment_id[]" id="existing_attachment_id_input" size="6"/><br /> - <a href="{$smarty.const.LIBERTY_PKG_URL}attachment_browser.php" title="{tr}Opens attachment browser in new window{/tr}" onkeypress="popUpWin(this.href,'standard',600,400);" onclick="popUpWin(this.href,'standard',600,400);return false;">{tr}Attachment Browser{/tr}</a> + {jspopup href="`$smarty.const.LIBERTY_PKG_URL`attachment_browser.php" title="Attachment browser"} {/forminput} </div> diff --git a/templates/edit_structure_content.tpl b/templates/edit_structure_content.tpl index 6142d00..d1fb164 100644 --- a/templates/edit_structure_content.tpl +++ b/templates/edit_structure_content.tpl @@ -25,7 +25,7 @@ {/forminput} {forminput} - {html_options multiple="multiple" id="content" size="12" name="content[]" values=$contentList options=$contentList selected=$pigeonInfo.selected_content} + {html_options multiple="multiple" id="content" size="12" name="content[]" values=$contentList options=$contentList} {/forminput} {forminput} |
