From: Jean-francois B. <ou...@fr...> - 2009-07-08 07:05:52
|
1/ Concerning the if condition, PHP_Beautifier just check the original code and if there is no { it put all on one line. I propose to modify manually all the PHP file with condition without { }. 2/ Link to documentation : http://beautifyphp.sourceforge.net/docs/ 3/ Concerning the array, i agree with you, it was a good idea at start but now i think it's not necessary. 4/I propose to create a branche experimental to test and customize Php_beautifier to feet our need. Jean-François B. --- En date de : Mar 7.7.09, Sylvie Greverend <sgr...@gm...> a écrit : De: Sylvie Greverend <sgr...@gm...> Objet: Re: [Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[19988] trunk À: "CVS/SVN commits information" <tik...@li...>, "Jean-francois BILGER" <ou...@fr...> Date: Mardi 7 Juillet 2009, 21h25 changi67 is doing a huge job of re-indenting the code ( We did that 5 years ago already), and I think that reindeting like this is useless. 1/This kind of tool must be integrated to the commit process. As soon as somebody commits, the code is 'broken' again'. I will try to do some research how to integrate this to svn if noboy else has a clue. 2/ What is exactly the tool that is used now. A link to the documentation could be great. THere are tons of php beautitifier. Some modificatios are : a/ It deletes the empty lines - but these empty lines are often there to delimit parts of code b/ It transforms if (a) b to if (a) b I think we etablish a rule to always put {} c/ It aligns elements of an array with tab ans space For instance list(a,b,c) = array('', '', ''); will become list(a,b,c) = array('' '', '' ); No space already back in. So what about a little pauses in the commits - and a little time to find the right solution Thanks sylvie On Tue, 2009-07-07 at 19:01 +0000, cha...@us... wrote: > Revision: 19988 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=19988&view=rev > Author: changi67 > Date: 2009-07-07 19:01:42 +0000 (Tue, 07 Jul 2009) > > Log Message: > ----------- > [MOD] Identation + Copyright > > Modified Paths: > -------------- > trunk/tiki-lastchanges.php > trunk/tiki-layout_options.php > trunk/tiki-likepages.php > trunk/tiki-list_articles.php > trunk/tiki-list_banners.php > trunk/tiki-list_blogs.php > trunk/tiki-list_cache.php > trunk/tiki-list_comments.php > trunk/tiki-list_contents.php > trunk/tiki-list_faqs.php > trunk/tiki-list_file_gallery.php > trunk/tiki-list_gallery.php > trunk/tiki-list_games.php > trunk/tiki-list_integrator_repositories.php > trunk/tiki-list_object_permissions.php > trunk/tiki-list_posts.php > trunk/tiki-list_quizzes.php > trunk/tiki-list_submissions.php > trunk/tiki-list_surveys.php > trunk/tiki-list_trackers.php > trunk/tiki-list_users.php > trunk/tiki-listmovies.php > trunk/tiki-listpages.php > trunk/tiki-live_support_admin.php > trunk/tiki-live_support_chat_frame.php > trunk/tiki-live_support_chat_window.php > trunk/tiki-live_support_client.php > trunk/tiki-live_support_console.php > trunk/tiki-live_support_message.php > trunk/tiki-live_support_server.php > trunk/tiki-live_support_transcripts.php > trunk/tiki-login.php > trunk/tiki-login_openid.php > trunk/tiki-login_scr.php > trunk/tiki-login_validate.php > trunk/tiki-logout.php > trunk/tiki-mailin-code.php > trunk/tiki-mailin.php > trunk/tiki-map.php > trunk/tiki-map_edit.php > trunk/tiki-map_history.php > trunk/tiki-map_rss.php > trunk/tiki-map_upload.php > trunk/tiki-mindmap.php > trunk/tiki-minical.php > trunk/tiki-minical_export.php > trunk/tiki-minical_prefs.php > trunk/tiki-minical_reminders.php > trunk/tiki-minichat_ajax.php > trunk/tiki-mobile.php > trunk/tiki-mods.php > trunk/tiki-mods_admin.php > trunk/tiki-module.php > trunk/tiki-module_controls.php > trunk/tiki-modules.php > trunk/tiki-my_tiki.php > trunk/tiki-mytiki_shared.php > trunk/tiki-newsletter_archives.php > trunk/tiki-newsletters.php > trunk/tiki-newsreader_groups.php > trunk/tiki-newsreader_news.php > trunk/tiki-newsreader_read.php > trunk/tiki-newsreader_servers.php > trunk/tiki-notepad_get.php > trunk/tiki-notepad_list.php > trunk/tiki-notepad_read.php > trunk/tiki-notepad_write.php > trunk/tiki-object_watches.php > trunk/tiki-objectpermissions.php > trunk/tiki-old_polls.php > trunk/tiki-orphan_pages.php > trunk/tiki-page.php > trunk/tiki-page_loader.php > trunk/tiki-pagehistory.php > trunk/tiki-parsemode_setup.php > trunk/tiki-phpinfo.php > trunk/tiki-pick_avatar.php > trunk/tiki-plugins.php > trunk/tiki-poll_form.php > trunk/tiki-poll_results.php > trunk/tiki-print.php > trunk/tiki-print_article.php > trunk/tiki-print_blog_post.php > trunk/tiki-print_indexed.php > trunk/tiki-print_multi_pages.php > trunk/tiki-print_pages.php > trunk/tiki-pv_chart.php > trunk/tiki-quiz_download_answer.php > trunk/tiki-quiz_edit.php > trunk/tiki-quiz_result_stats.php > trunk/tiki-quiz_stats.php > trunk/tiki-quiz_stats_quiz.php > > Modified: trunk/tiki-lastchanges.php > =================================================================== > --- trunk/tiki-lastchanges.php 2009-07-07 17:37:19 UTC (rev 19987) > +++ trunk/tiki-lastchanges.php 2009-07-07 19:01:42 UTC (rev 19988) > @@ -1,101 +1,78 @@ > <?php > - > -// $Id: /cvsroot/tikiwiki/tiki/tiki-lastchanges.php,v 1.19.2.1 2007-11-08 21:31:12 ricks99 Exp $ > - > -// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. > +// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project > +// > // All Rights Reserved. See copyright.txt for details and a complete list of authors. > // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. > - > -// Initialization > +// $Id: /cvsroot/tikiwiki/tiki/tiki-lastchanges.php,v 1.19.2.1 2007-11-08 21:31:12 ricks99 Exp $ > $section = 'wiki page'; > require_once ('tiki-setup.php'); > include_once ('lib/wiki/histlib.php'); > - > $auto_query_args = array('sort_mode', 'offset', 'find', 'days'); > - > -$smarty->assign('headtitle',tra('Last Changes')); > - > +$smarty->assign('headtitle', tra('Last Changes')); > if ($prefs['feature_wiki'] != 'y') { > - $smarty->assign('msg', tra("This feature is disabled").": feature_wiki"); > + $smarty->assign('msg', tra("This feature is disabled") . ": feature_wiki"); > $smarty->display("error.tpl"); > die; > } > - > if ($prefs['feature_lastChanges'] != 'y') { > - $smarty->assign('msg', tra("This feature is disabled").": feature_lastChanges"); > + $smarty->assign('msg', tra("This feature is disabled") . ": feature_lastChanges"); > $smarty->display("error.tpl"); > die; > } > - > -if($tiki_p_view != 'y') { > +if ($tiki_p_view != 'y') { > $smarty->assign('errortype', 401); > - $smarty->assign('msg',tra("Permission denied you cannot view this page")); > + $smarty->assign('msg', tra("Permission denied you cannot view this page")); > $smarty->display("error.tpl"); > - die; > + die; > } > - > if (!isset($_REQUEST["find"])) { > $findwhat = ''; > } else { > $findwhat = $_REQUEST["find"]; > } > - > $smarty->assign('find', $findwhat); > - > if (!isset($_REQUEST["days"])) { > $days = 1; > } else { > $days = $_REQUEST["days"]; > } > - > if (!isset($_REQUEST["sort_mode"])) { > $sort_mode = 'lastModif_desc'; > } else { > $sort_mode = $_REQUEST["sort_mode"]; > } > - > $smarty->assign_by_ref('days', $days); > $smarty->assign_by_ref('findwhat', $findwhat); > $smarty->assign_by_ref('sort_mode', $sort_mode); > - > if (!isset($_REQUEST["offset"])) { > $offset = 0; > } else { > $offset = $_REQUEST["offset"]; > } > - > $smarty->assign_by_ref('offset', $offset); > - > // Get a list of last changes to the Wiki database > $more = 0; > $lastchanges = $histlib->get_last_changes($days, $offset, $maxRecords, $sort_mode, $findwhat); > $smarty->assign_by_ref('cant_records', $lastchanges["cant"]); > - > // If there're more records then assign next_offset > $cant_pages = ceil($lastchanges["cant"] / $maxRecords); > $smarty->assign_by_ref('cant_pages', $cant_pages); > $smarty->assign('actual_page', 1 + ($offset / $maxRecords)); > - > if ($lastchanges["cant"] > ($offset + $maxRecords)) { > $smarty->assign('next_offset', $offset + $maxRecords); > } else { > $smarty->assign('next_offset', -1); > } > - > if ($offset > 0) { > $smarty->assign('prev_offset', $offset - $maxRecords); > } else { > $smarty->assign('prev_offset', -1); > } > - > $smarty->assign_by_ref('lastchanges', $lastchanges["data"]); > ask_ticket('lastchanges'); > - > include_once ('tiki-section_options.php'); > - > // disallow robots to index page: > $smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW'); > - > // Display the template > $smarty->assign('mid', 'tiki-lastchanges.tpl'); > $smarty->display("tiki.tpl"); > > Modified: trunk/tiki-layout_options.php > =================================================================== > --- trunk/tiki-layout_options.php 2009-07-07 17:37:19 UTC (rev 19987) > +++ trunk/tiki-layout_options.php 2009-07-07 19:01:42 UTC (rev 19988) > @@ -1,19 +1,15 @@ > <?php > - > -// $Id: /cvsroot/tikiwiki/tiki/tiki-layout_options.php,v 1.8 2007-03-06 19:29:49 sylvieg Exp $ > - > -// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. > +// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project > +// > // All Rights Reserved. See copyright.txt for details and a complete list of authors. > // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. > - > +// $Id: /cvsroot/tikiwiki/tiki/tiki-layout_options.php,v 1.8 2007-03-06 19:29:49 sylvieg Exp $ > //this script may only be included - so its better to die if called directly. > -if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) { > - header("location: index.php"); > - exit; > +if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__)) !== false) { > + header("location: index.php"); > + exit; > } > - > $section_top_bar = $section . '_top_bar'; > - > $section_bot_bar = $section . '_bot_bar'; > $section_left_column = $section . '_left_column'; > $section_right_column = $section . '_right_column'; > > Modified: trunk/tiki-likepages.php > =================================================================== > --- trunk/tiki-likepages.php 2009-07-07 17:37:19 UTC (rev 19987) > +++ trunk/tiki-likepages.php 2009-07-07 19:01:42 UTC (rev 19988) > @@ -1,89 +1,69 @@ > <?php > - > -// $Id: /cvsroot/tikiwiki/tiki/tiki-likepages.php,v 1.17 2007-10-12 07:55:28 nyloth Exp $ > - > -// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. > +// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project > +// > // All Rights Reserved. See copyright.txt for details and a complete list of authors. > // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. > - > -// Initialization > +// $Id: /cvsroot/tikiwiki/tiki/tiki-likepages.php,v 1.17 2007-10-12 07:55:28 nyloth Exp $ > $section = 'wiki page'; > require_once ('tiki-setup.php'); > - > include_once ('lib/wiki/wikilib.php'); > - > if ($prefs['feature_wiki'] != 'y') { > - $smarty->assign('msg', tra("This feature is disabled").": feature_wiki"); > - > + $smarty->assign('msg', tra("This feature is disabled") . ": feature_wiki"); > $smarty->display("error.tpl"); > die; > } > - > if ($prefs['feature_likePages'] != 'y') { > - $smarty->assign('msg', tra("This feature is disabled").": feature_likePages"); > - > + $smarty->assign('msg', tra("This feature is disabled") . ": feature_likePages"); > $smarty->display("error.tpl"); > die; > } > - > // Get the page from the request var or default it to HomePage > if (!isset($_REQUEST["page"])) { > $smarty->assign('msg', tra("No page indicated")); > - > $smarty->display("error.tpl"); > die; > } else { > $page = $_REQUEST["page"]; > - > $smarty->assign_by_ref('page', $_REQUEST["page"]); > } > - > if (!($info = $tikilib->get_page_info($page))) { > $smarty->assign('msg', tra('Page cannot be found')); > $smarty->display('error.tpl'); > die; > } > - > // Now check permissions to access this page > -$tikilib->get_perm_object( $page, 'wiki page', $info); > +$tikilib->get_perm_object($page, 'wiki page', $info); > if ($tiki_p_view != 'y') { > $smarty->assign('errortype', 401); > $smarty->assign('msg', tra("Permission denied you cannot view pages like this page")); > - > $smarty->display("error.tpl"); > die; > } > - > $likepages = $wikilib->get_like_pages($page); > - > // If the page doesn't exist then display an error > if (!$tikilib->page_exists($page)) { > - if(count($likepages) == 1 ) { > - header ("Status: 402 Found"); /* PHP3 */ > - header ("HTTP/1.0 402 Found"); /* PHP4 */ > - header("Location: tiki-index.php?page=$likepages[0]"); > - die; > - } > - $smarty->assign('page_exists', 'n'); > - if( count($likepages) <1 ) { > - header ("Status: 404 Not Found"); /* PHP3 */ > - header ("HTTP/1.0 404 Not Found"); /* PHP4 */ > - $smarty->assign('headtitle',tra("Page cannot be found")); > - $smarty->assign('errortitle',tra("Page cannot be found")." (404)"); > - $smarty->assign('errortype', '404'); > - $smarty->display("error.tpl"); > - die; > - } > + if (count($likepages) == 1) { > + header("Status: 402 Found"); /* PHP3 */ > + header("HTTP/1.0 402 Found"); /* PHP4 */ > + header("Location: tiki-index.php?page=$likepages[0]"); > + die; > + } > + $smarty->assign('page_exists', 'n'); > + if (count($likepages) < 1) { > + header("Status: 404 Not Found"); /* PHP3 */ > + header("HTTP/1.0 404 Not Found"); /* PHP4 */ > + $smarty->assign('headtitle', tra("Page cannot be found")); > + $smarty->assign('errortitle', tra("Page cannot be found") . " (404)"); > + $smarty->assign('errortype', '404'); > + $smarty->display("error.tpl"); > + die; > + } > } > - > $smarty->assign_by_ref('likepages', $likepages); > ask_ticket('likepages'); > - > // disallow robots to index page: > $smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW'); > - > include_once ('tiki-section_options.php'); > - > // Display the template > $smarty->assign('mid', 'tiki-likepages.tpl'); > $smarty->display("tiki.tpl"); > > Modified: trunk/tiki-list_articles.php > =================================================================== > --- trunk/tiki-list_articles.php 2009-07-07 17:37:19 UTC (rev 19987) > +++ trunk/tiki-list_articles.php 2009-07-07 19:01:42 UTC (rev 19988) > @@ -1,52 +1,40 @@ > <?php > - > -// $Id: /cvsroot/tikiwiki/tiki/tiki-list_articles.php,v 1.38.2.2 2008-03-21 23:06:51 sylvieg Exp $ > - > -// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. > +// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project > +// > // All Rights Reserved. See copyright.txt for details and a complete list of authors. > // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. > - > -// Initialization > +// $Id: /cvsroot/tikiwiki/tiki/tiki-list_articles.php,v 1.38.2.2 2008-03-21 23:06:51 sylvieg Exp $ > $section = 'cms'; > require_once ('tiki-setup.php'); > - > include_once ('lib/articles/artlib.php'); > - > -$smarty->assign('headtitle',tra('List Articles')); > - > +$smarty->assign('headtitle', tra('List Articles')); > if ($prefs['feature_articles'] != 'y') { > - $smarty->assign('msg', tra("This feature is disabled").": feature_articles"); > - > + $smarty->assign('msg', tra("This feature is disabled") . ": feature_articles"); > $smarty->display("error.tpl"); > die; > } > - > // Now check permissions to access this page > -if($tiki_p_read_article != 'y') { > +if ($tiki_p_read_article != 'y') { > $smarty->assign('errortype', 401); > - $smarty->assign('msg',tra("Permission denied you cannot view pages")); > + $smarty->assign('msg', tra("Permission denied you cannot view pages")); > $smarty->display("error.tpl"); > - die; > + die; > } > - > if (isset($_REQUEST["remove"])) { > - > if ($tiki_p_remove_article != 'y') { > $smarty->assign('errortype', 401); > $smarty->assign('msg', tra("Permission denied you cannot remove articles")); > - > $smarty->display("error.tpl"); > die; > } > - $area = 'delarticle'; > - if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > - key_check($area); > + $area = 'delarticle'; > + if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > + key_check($area); > $artlib->remove_article($_REQUEST["remove"]); > - } else { > - key_get($area); > - } > + } else { > + key_get($area); > + } > } > - > // This script can receive the thresold > // for the information as the number of > // days to get in the log 1,3,4,etc > @@ -56,9 +44,7 @@ > } else { > $sort_mode = $_REQUEST["sort_mode"]; > } > - > $smarty->assign_by_ref('sort_mode', $sort_mode); > - > // If offset is set use it if not then use offset =0 > // use the maxRecords php variable to set the limit > // if sortMode is not set then use lastModif_desc > @@ -74,37 +60,31 @@ > $maxRecords = $maxRecords; > } > $smarty->assign_by_ref('maxRecords', $maxRecords); > - > -if( ($tiki_p_admin == 'y') || ($tiki_p_admin_cms == 'y') ) { > - $date_max = ''; > -} elseif(isset($_SESSION["thedate"])) { > - if($_SESSION["thedate"]<$tikilib->now) { > - // If the session is older then set it to today > - // so you can list articles > - $date_max = $tikilib->now; > - } else { > - $date_max = $_SESSION["thedate"]; > - } > +if (($tiki_p_admin == 'y') || ($tiki_p_admin_cms == 'y')) { > + $date_max = ''; > +} elseif (isset($_SESSION["thedate"])) { > + if ($_SESSION["thedate"] < $tikilib->now) { > + // If the session is older then set it to today > + // so you can list articles > + $date_max = $tikilib->now; > + } else { > + $date_max = $_SESSION["thedate"]; > + } > } else { > $date_max = $tikilib->now; > } > - > if (isset($_REQUEST["find"])) { > $find = $_REQUEST["find"]; > } else { > $find = ''; > } > - > $smarty->assign('find', $find); > - > if (!isset($_REQUEST["type"])) { > $_REQUEST["type"] = ''; > } > - > if (!isset($_REQUEST["topic"])) { > $_REQUEST["topic"] = ''; > } > - > if (!isset($_REQUEST["categId"])) { > $_REQUEST["categId"] = ''; > } > @@ -115,27 +95,23 @@ > $smarty->assign('find_type', $_REQUEST["type"]); > $smarty->assign('find_categId', $_REQUEST["categId"]); > $smarty->assign('find_lang', $_REQUEST['lang']); > - > - > - > -$visible_only='y'; > -if( ($tiki_p_admin == 'y') || ($tiki_p_admin_cms == 'y') ) { $visible_only="n"; } > - > +$visible_only = 'y'; > +if (($tiki_p_admin == 'y') || ($tiki_p_admin_cms == 'y')) { > + $visible_only = "n"; > +} > // Get a list of last changes to the Wiki database > $listpages = $tikilib->list_articles($offset, $maxRecords, $sort_mode, $find, 0, $date_max, $user, $_REQUEST["type"], $_REQUEST["topic"], $visible_only, '', $_REQUEST["categId"], '', '', $_REQUEST['lang']); > // If there're more records then assign next_offset > $smarty->assign_by_ref('cant', $listpages['cant']); > - > $smarty->assign_by_ref('listpages', $listpages["data"]); > //print_r($listpages["data"]); > $topics = $artlib->list_topics(); > $smarty->assign_by_ref('topics', $topics); > - > $types = $artlib->list_types(); > $smarty->assign_by_ref('types', $types); > - > if ($prefs['feature_categories'] == 'y') { > - global $categlib; include_once ('lib/categories/categlib.php'); > + global $categlib; > + include_once ('lib/categories/categlib.php'); > $categories = $categlib->get_all_categories_ext(); > $smarty->assign_by_ref('categories', $categories); > } > @@ -144,25 +120,20 @@ > $languages = $tikilib->list_languages(false, 'y'); > $smarty->assign_by_ref('languages', $languages); > } > - > if ($tiki_p_edit_article != 'y' && $tiki_p_remove_article != 'y') { //check one editable > - foreach ($listpages['data'] as $page) { > + foreach($listpages['data'] as $page) { > if ($page['author'] == $user && $page['creator_edit'] == 'y') { > $smarty->assign('oneEditPage', 'y'); > break; > } > } > } > - > include_once ('tiki-section_options.php'); > - > -if ($prefs['feature_mobile'] =='y' && isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'mobile') { > +if ($prefs['feature_mobile'] == 'y' && isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'mobile') { > include_once ("lib/hawhaw/hawtikilib.php"); > - > HAWTIKI_list_articles($listpages, $tiki_p_read_article, $offset, $maxRecords, $listpages["cant"]); > } > ask_ticket('list-articles'); > - > // Display the template > $smarty->assign('mid', 'tiki-list_articles.tpl'); > $smarty->display("tiki.tpl"); > > Modified: trunk/tiki-list_banners.php > =================================================================== > --- trunk/tiki-list_banners.php 2009-07-07 17:37:19 UTC (rev 19987) > +++ trunk/tiki-list_banners.php 2009-07-07 19:01:42 UTC (rev 19988) > @@ -1,28 +1,20 @@ > <?php > - > -// $Id: /cvsroot/tikiwiki/tiki/tiki-list_banners.php,v 1.16 2007-10-12 07:55:28 nyloth Exp $ > - > -// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. > +// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project > +// > // All Rights Reserved. See copyright.txt for details and a complete list of authors. > // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. > - > -// Initialization > +// $Id: /cvsroot/tikiwiki/tiki/tiki-list_banners.php,v 1.16 2007-10-12 07:55:28 nyloth Exp $ > require_once ('tiki-setup.php'); > - > include_once ('lib/banners/bannerlib.php'); > - > if (!isset($bannerlib)) { > $bannerlib = new BannerLib($dbTiki); > } > - > // CHECK FEATURE BANNERS HERE > if ($prefs['feature_banners'] != 'y') { > - $smarty->assign('msg', tra("This feature is disabled").": feature_banners"); > - > + $smarty->assign('msg', tra("This feature is disabled") . ": feature_banners"); > $smarty->display("error.tpl"); > die; > } > - > // IF NOT LOGGED aND NOT ADMIN BAIL OUT > if ($tiki_p_admin != 'y') { > $smarty->assign('errortype', 401); > @@ -30,7 +22,6 @@ > $smarty->display("error.tpl"); > die; > } > - > if (isset($_REQUEST["remove"])) { > if ($tiki_p_admin_banners != 'y') { > $smarty->assign('errortype', 401); > @@ -38,15 +29,14 @@ > $smarty->display("error.tpl"); > die; > } > - $area = 'delbanner'; > - if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > - key_check($area); > + $area = 'delbanner'; > + if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > + key_check($area); > $bannerlib->remove_banner($_REQUEST["remove"]); > - } else { > - key_get($area); > - } > + } else { > + key_get($area); > + } > } > - > // This script can receive the thresold > // for the information as the number of > // days to get in the log 1,3,4,etc > @@ -56,9 +46,7 @@ > } else { > $sort_mode = $_REQUEST["sort_mode"]; > } > - > $smarty->assign_by_ref('sort_mode', $sort_mode); > - > // If offset is set use it if not then use offset =0 > // use the maxRecords php variable to set the limit > // if sortMode is not set then use lastModif_desc > @@ -67,26 +55,19 @@ > } else { > $offset = $_REQUEST["offset"]; > } > - > $smarty->assign_by_ref('offset', $offset); > - > if (isset($_REQUEST["find"])) { > $find = $_REQUEST["find"]; > } else { > $find = ''; > } > - > $smarty->assign('find', $find); > - > // Get a list of last changes to the Wiki database > $who = 'admin'; > - > $listpages = $bannerlib->list_banners($offset, $maxRecords, $sort_mode, $find, $who); > $smarty->assign_by_ref('cant_pages', $listpages["cant"]); > - > $smarty->assign_by_ref('listpages', $listpages["data"]); > ask_ticket('list-banners'); > - > // Display the template > $smarty->assign('mid', 'tiki-list_banners.tpl'); > $smarty->display("tiki.tpl"); > > Modified: trunk/tiki-list_blogs.php > =================================================================== > --- trunk/tiki-list_blogs.php 2009-07-07 17:37:19 UTC (rev 19987) > +++ trunk/tiki-list_blogs.php 2009-07-07 19:01:42 UTC (rev 19988) > @@ -1,43 +1,30 @@ > <?php > - > -// $Id: /cvsroot/tikiwiki/tiki/tiki-list_blogs.php,v 1.30.2.1 2007-11-08 21:38:33 ricks99 Exp $ > - > -// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. > +// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project > +// > // All Rights Reserved. See copyright.txt for details and a complete list of authors. > // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. > - > -// Initialization > +// $Id: /cvsroot/tikiwiki/tiki/tiki-list_blogs.php,v 1.30.2.1 2007-11-08 21:38:33 ricks99 Exp $ > $section = 'blogs'; > require_once ('tiki-setup.php'); > - > include_once ('lib/blogs/bloglib.php'); > - > -$smarty->assign('headtitle',tra('Blogs')); > - > +$smarty->assign('headtitle', tra('Blogs')); > if ($prefs['feature_categories'] == 'y') { > include_once ('lib/categories/categlib.php'); > } > - > if ($prefs['feature_blogs'] != 'y') { > - $smarty->assign('msg', tra("This feature is disabled").": feature_blogs"); > - > + $smarty->assign('msg', tra("This feature is disabled") . ": feature_blogs"); > $smarty->display("error.tpl"); > die; > } > - > if ($tiki_p_read_blog != 'y') { > $smarty->assign('errortype', 401); > $smarty->assign('msg', tra("Permission denied you can not view this section")); > - > $smarty->display("error.tpl"); > die; > } > - > if (isset($_REQUEST["remove"])) { > - > // Check if it is the owner > $data = $tikilib->get_blog($_REQUEST["remove"]); > - > if ($data["user"] != $user) { > if ($tiki_p_blog_admin != 'y') { > $smarty->assign('errortype', 401); > @@ -46,16 +33,14 @@ > die; > } > } > - $area = 'delblog'; > - if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > - key_check($area); > + $area = 'delblog'; > + if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > + key_check($area); > $bloglib->remove_blog($_REQUEST["remove"]); > - } else { > - key_get($area); > - } > - > + } else { > + key_get($area); > + } > } > - > // This script can receive the thresold > // for the information as the number of > // days to get in the log 1,3,4,etc > @@ -65,9 +50,7 @@ > } else { > $sort_mode = $_REQUEST["sort_mode"]; > } > - > $smarty->assign_by_ref('sort_mode', $sort_mode); > - > // If offset is set use it if not then use offset =0 > // use the maxRecords php variable to set the limit > // if sortMode is not set then use lastModif_desc > @@ -76,42 +59,32 @@ > } else { > $offset = $_REQUEST["offset"]; > } > - > $smarty->assign_by_ref('offset', $offset); > - > if (isset($_REQUEST["find"])) { > $find = $_REQUEST["find"]; > } else { > $find = ''; > } > - > $smarty->assign('find', $find); > - > // Get a list of last changes to the Wiki database > $listpages = $tikilib->list_blogs($offset, $maxRecords, $sort_mode, $find); > - > $temp_max = count($listpages["data"]); > for ($i = 0; $i < $temp_max; $i++) { > if ($userlib->object_has_one_permission($listpages["data"][$i]["blogId"], 'blog')) { > $listpages["data"][$i]["individual"] = 'y'; > - > // blogs that user cannot read are not displayed at all > $listpages["data"][$i]["individual_tiki_p_read_blog"] = 'y'; > - > if ($userlib->object_has_permission($user, $listpages["data"][$i]["blogId"], 'blog', 'tiki_p_blog_post')) { > $listpages["data"][$i]["individual_tiki_p_blog_post"] = 'y'; > } else { > $listpages["data"][$i]["individual_tiki_p_blog_post"] = 'n'; > } > - > if ($userlib->object_has_permission($user, $listpages["data"][$i]["blogId"], 'blog', 'tiki_p_create_blogs')) { > $listpages["data"][$i]["individual_tiki_p_create_blogs"] = 'y'; > } else { > $listpages["data"][$i]["individual_tiki_p_create_blogs"] = 'n'; > } > - > - if ($tiki_p_admin == 'y' || $userlib->object_has_permission($user, $listpages["data"][$i]["blogId"], 'blog', 'tiki_p_blog_admin')) > - { > + if ($tiki_p_admin == 'y' || $userlib->object_has_permission($user, $listpages["data"][$i]["blogId"], 'blog', 'tiki_p_blog_admin')) { > $listpages["data"][$i]["individual_tiki_p_create_blogs"] = 'y'; > $listpages["data"][$i]["individual_tiki_p_blog_post"] = 'y'; > } > @@ -119,19 +92,14 @@ > $listpages["data"][$i]["individual"] = 'n'; > } > } > - > $smarty->assign_by_ref('listpages', $listpages["data"]); > $smarty->assign_by_ref('cant', $listpages["cant"]); > - > include_once ('tiki-section_options.php'); > - > -if ($prefs['feature_mobile'] =='y' && isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'mobile') { > +if ($prefs['feature_mobile'] == 'y' && isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'mobile') { > include_once ("lib/hawhaw/hawtikilib.php"); > - > HAWTIKI_list_blogs($listpages, $tiki_p_read_blog); > } > ask_ticket('list-blogs'); > - > // Display the template > $smarty->assign('mid', 'tiki-list_blogs.tpl'); > $smarty->display("tiki.tpl"); > > Modified: trunk/tiki-list_cache.php > =================================================================== > --- trunk/tiki-list_cache.php 2009-07-07 17:37:19 UTC (rev 19987) > +++ trunk/tiki-list_cache.php 2009-07-07 19:01:42 UTC (rev 19988) > @@ -1,36 +1,29 @@ > <?php > - > -// $Id: /cvsroot/tikiwiki/tiki/tiki-list_cache.php,v 1.14 2007-10-12 07:55:28 nyloth Exp $ > - > -// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. > +// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project > +// > // All Rights Reserved. See copyright.txt for details and a complete list of authors. > // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. > - > -// Initialization > +// $Id: /cvsroot/tikiwiki/tiki/tiki-list_cache.php,v 1.14 2007-10-12 07:55:28 nyloth Exp $ > require_once ('tiki-setup.php'); > - > if ($tiki_p_admin != 'y') { > $smarty->assign('errortype', 401); > $smarty->assign('msg', tra("You do not have permission to use this feature")); > $smarty->display("error.tpl"); > die; > } > - > if (isset($_REQUEST["remove"])) { > - $area = 'delcache'; > - if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > - key_check($area); > + $area = 'delcache'; > + if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > + key_check($area); > $tikilib->remove_cache($_REQUEST["remove"]); > - } else { > - key_get($area); > - } > + } else { > + key_get($area); > + } > } > - > if (isset($_REQUEST["refresh"])) { > check_ticket('list-cache'); > $tikilib->refresh_cache($_REQUEST["refresh"]); > } > - > // This script can receive the thresold > // for the information as the number of > // days to get in the log 1,3,4,etc > @@ -40,9 +33,7 @@ > } else { > $sort_mode = $_REQUEST["sort_mode"]; > } > - > $smarty->assign_by_ref('sort_mode', $sort_mode); > - > // If offset is set use it if not then use offset =0 > // use the maxRecords php variable to set the limit > // if sortMode is not set then use lastModif_desc > @@ -51,26 +42,19 @@ > } else { > $offset = $_REQUEST["offset"]; > } > - > $smarty->assign_by_ref('offset', $offset); > - > if (!isset($_REQUEST["find"])) { > $find = ''; > } else { > $find = $_REQUEST["find"]; > } > - > $smarty->assign('find', $find); > - > // Get a list of last changes to the Wiki database > $listpages = $tikilib->list_cache($offset, $maxRecords, $sort_mode, $find); > - > $smarty->assign_by_ref('cant_pages', $listpages["cant"]); > - > $smarty->assign_by_ref('listpages', $listpages["data"]); > //print_r($listpages["data"]); > ask_ticket('list-cache'); > - > // Display the template > $smarty->assign('mid', 'tiki-list_cache.tpl'); > $smarty->display("tiki.tpl"); > > Modified: trunk/tiki-list_comments.php > =================================================================== > --- trunk/tiki-list_comments.php 2009-07-07 17:37:19 UTC (rev 19987) > +++ trunk/tiki-list_comments.php 2009-07-07 19:01:42 UTC (rev 19988) > @@ -1,158 +1,123 @@ > -<?php > - > -// $Id: /cvsroot/tikiwiki/tiki/tiki-list_comments.php,v 1.2.2.1 2007-11-04 22:08:04 nyloth Exp $ > - > -// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. > -// All Rights Reserved. See copyright.txt for details and a complete list of authors. > -// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. > - > -require_once('tiki-setup.php'); > -include_once('lib/commentslib.php'); > -$auto_query_args = array('types_section','types','show_types','sort_mode','offset','find','findfilter_approved'); > - > -$commentslib = new Comments($dbTiki); > - > -if ($tiki_p_admin_comments != 'y') { > - $smarty->assign('errortype', 401); > - $smarty->assign('msg', tra("You do not have permission to use this feature")); > - $smarty->display("error.tpl"); > - die; > -} > - > -$title = tra('Comments'); > -$sections_keys = array( > - 'objectType' => 'commentsFeature', > - 'itemObjectType' => 'itemCommentsFeature' > -); > - > -// types_section is used to limit the user to only one section (e.g. 'blogs') > -if ( isset($_REQUEST['types_section']) && isset($sections_enabled[$_REQUEST['types_section']]) ) { > - $title = $title.' - '.tra(ucwords($_REQUEST['types_section'])); > - $smarty->assign_by_ref('types_section', $_REQUEST['types_section']); > -} > - > -if ( isset($_REQUEST['types']) ) { > - $requested_types = $_REQUEST['types']; > - $default_list_value = 'n'; > -} else { > - $requested_types = array(); > - $default_list_value = 'y'; > -} > -$smarty->assign_by_ref('title', $title); > - > -$show_types = array(); > -$selected_types = array(); > -foreach ( $sections_enabled as $k => $info ) { > - if ( isset($_REQUEST['types_section']) && $k != $_REQUEST['types_section'] ) continue; > - foreach ( $sections_keys as $stype => $sfeature ) { > - if ( isset($info[$sfeature]) && $prefs[$info[$sfeature]] == 'y' && isset($info[$stype]) ) { > - > - // Blog hack, needed because both objectType and itemObjectType of blogs are currently defined as 'blog post' > - if ( $info[$stype] == 'blog post' && $stype == 'objectType' ) { > - $comment_type = 'blog'; > - if ( isset($requested_types[$info[$stype]]) ) { > - $requested_types[] = $comment_type; > - } > - } else $comment_type = $info[$stype]; > - > - $show_types[$comment_type] = ucwords($comment_type); > - if ( $default_list_value == 'y' || in_array($comment_type, $requested_types) ) { > - $selected_types[] = $comment_type; > - } > - } > - } > -} > - > -// No need to show types choices if there is only one choice that is already choosed > -if ( count($show_types) == 1 && count($selected_types) == 1 ) $show_types = array(); > - > -$headers = array( > - 'title' => 'Title', > - 'objectType' => 'Type', > - 'object' => 'Object', > - 'userName' => 'Author', > - 'user_ip' => 'IP', > - 'commentDate' => 'Date', > - 'data' => 'Comment', > -); > - > -if ( count($selected_types) == 1 ) { > - unset($headers['objectType']); > - $headers['object'] = tra(ucwords($selected_types[0])); > -} > - > -$smarty->assign_by_ref('show_types', $show_types); > -$smarty->assign_by_ref('selected_types', $selected_types); > -$smarty->assign_by_ref('headers', $headers); > - > -// Handle actions > -if ( isset($_REQUEST['checked']) ) { > - check_ticket('list_comments'); > - $checked = is_array($_REQUEST['checked']) ? $_REQUEST['checked'] : array($_REQUEST['checked']); > - > - // Delete comment(s) > - if ( isset($_REQUEST['remove']) ) { > - $area = 'removecomment'; > - if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > - key_check($area); > - foreach ( $checked as $id ) { > - $commentslib->remove_comment($id); > - } > - } else { > - key_get($area, tra('Delete comments')); > - } > - } > - > - // Approve/Reject comment(s) > - if ( $prefs['feature_comments_moderation'] == 'y' && isset($_REQUEST['approve']) && in_array($_REQUEST['approve'], array('y','n','r')) ) { > - foreach ( $checked as $id ) { > - $commentslib->approve_comment($id, $_REQUEST['approve']); > - } > - } > -} > - > -if (isset($_REQUEST["sort_mode"])) { > - $sort_mode = $_REQUEST["sort_mode"]; > -} else { > - $sort_mode = 'commentDate_desc'; > -} > -$smarty->assign_by_ref('sort_mode', $sort_mode); > - > -if (isset($_REQUEST["offset"])) { > - $offset = $_REQUEST["offset"]; > -} else { > - $offset = 0; > -} > -$smarty->assign_by_ref('offset', $offset); > - > -if (isset($_REQUEST["find"])) { > - $find = strip_tags($_REQUEST["find"]); > -} else { > - $find = ''; > -} > -$smarty->assign_by_ref('find', $find); > - > -if ( ! isset($_REQUEST['findfilter_approved']) ) $_REQUEST['findfilter_approved'] = ''; > -if ( $prefs['feature_comments_moderation'] == 'y' ) { > - $filter_values = array('approved' => $_REQUEST['findfilter_approved']); > - $filter_names = array('approved' => tra('Approved Status')); > - $filters = array('approved' => array('n' => tra('Queued'), 'y' => tra('Approved'), 'r' => tra('Rejected'))); > - asort($filters['approved']); > -} else { > - $filters = $filter_names = $filter_values = array(); > -} > - > -$comments = $commentslib->get_all_comments($selected_types, $offset, $maxRecords, $sort_mode, $find, 'y', $_REQUEST['findfilter_approved']); > -foreach ( $comments['data'] as $k => $v ) { > - if ( $v['objectType'] == 'post' ) $comments['data'][$k]['objectType'] = 'blog post'; > -} > - > -$smarty->assign_by_ref('comments', $comments['data']); > -$smarty->assign_by_ref('filters', $filters); > -$smarty->assign_by_ref('filter_names', $filter_names); > -$smarty->assign_by_ref('filter_values', $filter_values); > -$smarty->assign_by_ref('cant', $comments['cant']); > - > -ask_ticket('list_comments'); > -$smarty->assign('mid', 'tiki-list_comments.tpl'); > -$smarty->display('tiki.tpl'); > +<?php > +// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project > +// > +// All Rights Reserved. See copyright.txt for details and a complete list of authors. > +// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. > +// $Id: /cvsroot/tikiwiki/tiki/tiki-list_comments.php,v 1.2.2.1 2007-11-04 22:08:04 nyloth Exp $ > +require_once ('tiki-setup.php'); > +include_once ('lib/commentslib.php'); > +$auto_query_args = array('types_section', 'types', 'show_types', 'sort_mode', 'offset', 'find', 'findfilter_approved'); > +$commentslib = new Comments($dbTiki); > +if ($tiki_p_admin_comments != 'y') { > + $smarty->assign('errortype', 401); > + $smarty->assign('msg', tra("You do not have permission to use this feature")); > + $smarty->display("error.tpl"); > + die; > +} > +$title = tra('Comments'); > +$sections_keys = array('objectType' => 'commentsFeature', 'itemObjectType' => 'itemCommentsFeature'); > +// types_section is used to limit the user to only one section (e.g. 'blogs') > +if (isset($_REQUEST['types_section']) && isset($sections_enabled[$_REQUEST['types_section']])) { > + $title = $title . ' - ' . tra(ucwords($_REQUEST['types_section'])); > + $smarty->assign_by_ref('types_section', $_REQUEST['types_section']); > +} > +if (isset($_REQUEST['types'])) { > + $requested_types = $_REQUEST['types']; > + $default_list_value = 'n'; > +} else { > + $requested_types = array(); > + $default_list_value = 'y'; > +} > +$smarty->assign_by_ref('title', $title); > +$show_types = array(); > +$selected_types = array(); > +foreach($sections_enabled as $k => $info) { > + if (isset($_REQUEST['types_section']) && $k != $_REQUEST['types_section']) continue; > + foreach($sections_keys as $stype => $sfeature) { > + if (isset($info[$sfeature]) && $prefs[$info[$sfeature]] == 'y' && isset($info[$stype])) { > + // Blog hack, needed because both objectType and itemObjectType of blogs are currently defined as 'blog post' > + if ($info[$stype] == 'blog post' && $stype == 'objectType') { > + $comment_type = 'blog'; > + if (isset($requested_types[$info[$stype]])) { > + $requested_types[] = $comment_type; > + } > + } else $comment_type = $info[$stype]; > + $show_types[$comment_type] = ucwords($comment_type); > + if ($default_list_value == 'y' || in_array($comment_type, $requested_types)) { > + $selected_types[] = $comment_type; > + } > + } > + } > +} > +// No need to show types choices if there is only one choice that is already choosed > +if (count($show_types) == 1 && count($selected_types) == 1) $show_types = array(); > +$headers = array('title' => 'Title', 'objectType' => 'Type', 'object' => 'Object', 'userName' => 'Author', 'user_ip' => 'IP', 'commentDate' => 'Date', 'data' => 'Comment',); > +if (count($selected_types) == 1) { > + unset($headers['objectType']); > + $headers['object'] = tra(ucwords($selected_types[0])); > +} > +$smarty->assign_by_ref('show_types', $show_types); > +$smarty->assign_by_ref('selected_types', $selected_types); > +$smarty->assign_by_ref('headers', $headers); > +// Handle actions > +if (isset($_REQUEST['checked'])) { > + check_ticket('list_comments'); > + $checked = is_array($_REQUEST['checked']) ? $_REQUEST['checked'] : array($_REQUEST['checked']); > + // Delete comment(s) > + if (isset($_REQUEST['remove'])) { > + $area = 'removecomment'; > + if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > + key_check($area); > + foreach($checked as $id) { > + $commentslib->remove_comment($id); > + } > + } else { > + key_get($area, tra('Delete comments')); > + } > + } > + // Approve/Reject comment(s) > + if ($prefs['feature_comments_moderation'] == 'y' && isset($_REQUEST['approve']) && in_array($_REQUEST['approve'], array('y', 'n', 'r'))) { > + foreach($checked as $id) { > + $commentslib->approve_comment($id, $_REQUEST['approve']); > + } > + } > +} > +if (isset($_REQUEST["sort_mode"])) { > + $sort_mode = $_REQUEST["sort_mode"]; > +} else { > + $sort_mode = 'commentDate_desc'; > +} > +$smarty->assign_by_ref('sort_mode', $sort_mode); > +if (isset($_REQUEST["offset"])) { > + $offset = $_REQUEST["offset"]; > +} else { > + $offset = 0; > +} > +$smarty->assign_by_ref('offset', $offset); > +if (isset($_REQUEST["find"])) { > + $find = strip_tags($_REQUEST["find"]); > +} else { > + $find = ''; > +} > +$smarty->assign_by_ref('find', $find); > +if (!isset($_REQUEST['findfilter_approved'])) $_REQUEST['findfilter_approved'] = ''; > +if ($prefs['feature_comments_moderation'] == 'y') { > + $filter_values = array('approved' => $_REQUEST['findfilter_approved']); > + $filter_names = array('approved' => tra('Approved Status')); > + $filters = array('approved' => array('n' => tra('Queued'), 'y' => tra('Approved'), 'r' => tra('Rejected'))); > + asort($filters['approved']); > +} else { > + $filters = $filter_names = $filter_values = array(); > +} > +$comments = $commentslib->get_all_comments($selected_types, $offset, $maxRecords, $sort_mode, $find, 'y', $_REQUEST['findfilter_approved']); > +foreach($comments['data'] as $k => $v) { > + if ($v['objectType'] == 'post') $comments['data'][$k]['objectType'] = 'blog post'; > +} > +$smarty->assign_by_ref('comments', $comments['data']); > +$smarty->assign_by_ref('filters', $filters); > +$smarty->assign_by_ref('filter_names', $filter_names); > +$smarty->assign_by_ref('filter_values', $filter_values); > +$smarty->assign_by_ref('cant', $comments['cant']); > +ask_ticket('list_comments'); > +$smarty->assign('mid', 'tiki-list_comments.tpl'); > +$smarty->display('tiki.tpl'); > > Modified: trunk/tiki-list_contents.php > =================================================================== > --- trunk/tiki-list_contents.php 2009-07-07 17:37:19 UTC (rev 19987) > +++ trunk/tiki-list_contents.php 2009-07-07 19:01:42 UTC (rev 19988) > @@ -1,74 +1,57 @@ > <?php > - > -// $Id: /cvsroot/tikiwiki/tiki/tiki-list_contents.php,v 1.17 2007-10-12 07:55:28 nyloth Exp $ > - > -// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. > +// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project > +// > // All Rights Reserved. See copyright.txt for details and a complete list of authors. > // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. > - > -// Initialization > +// $Id: /cvsroot/tikiwiki/tiki/tiki-list_contents.php,v 1.17 2007-10-12 07:55:28 nyloth Exp $ > require_once ('tiki-setup.php'); > include_once ('lib/dcs/dcslib.php'); > -$auto_query_args = array('sort_mode','offset','find'); > - > +$auto_query_args = array('sort_mode', 'offset', 'find'); > if (!isset($dcslib)) { > $dcslib = new DCSLib($dbTiki); > } > - > if ($prefs['feature_dynamic_content'] != 'y') { > - $smarty->assign('msg', tra("This feature is disabled").": feature_dynamic_content"); > - > + $smarty->assign('msg', tra("This feature is disabled") . ": feature_dynamic_content"); > $smarty->display("error.tpl"); > die; > } > - > if ($tiki_p_admin_dynamic != 'y') { > $smarty->assign('errortype', 401); > $smarty->assign('msg', tra("You do not have permission to use this feature")); > - > $smarty->display("error.tpl"); > die; > } > - > if (isset($_REQUEST["remove"])) { > - $area = 'delcontents'; > - if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > - key_check($area); > - $dcslib->remove_contents($_REQUEST["remove"]); > - } else { > - key_get($area); > - } > + $area = 'delcontents'; > + if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > + key_check($area); > + $dcslib->remove_contents($_REQUEST["remove"]); > + } else { > + key_get($area); > + } > } > - > $smarty->assign('description', ''); > $smarty->assign('contentLabel', ''); > $smarty->assign('contentId', 0); > - > if (isset($_REQUEST["save"])) { > check_ticket('list-contents'); > $smarty->assign('description', $_REQUEST["description"]); > $smarty->assign('contentLabel', $_REQUEST["contentLabel"]); > - > $id = $dcslib->replace_content($_REQUEST["contentId"], $_REQUEST["description"], $_REQUEST["contentLabel"]); > $smarty->assign('contentId', $id); > } > - > if (isset($_REQUEST["edit"])) { > $info = $dcslib->get_content($_REQUEST["edit"]); > - > $smarty->assign('contentId', $info["contentId"]); > $smarty->assign('description', $info["description"]); > $smarty->assign('contentLabel', $info["contentLabel"]); > } > - > if (!isset($_REQUEST["sort_mode"])) { > $sort_mode = 'contentId_desc'; > } else { > $sort_mode = $_REQUEST["sort_mode"]; > } > - > $smarty->assign_by_ref('sort_mode', $sort_mode); > - > // If offset is set use it if not then use offset =0 > // use the maxRecords php variable to set the limit > if (!isset($_REQUEST["offset"])) { > @@ -76,23 +59,18 @@ > } else { > $offset = $_REQUEST["offset"]; > } > - > $smarty->assign_by_ref('offset', $offset); > - > if (isset($_REQUEST["find"])) { > $find = $_REQUEST["find"]; > } else { > $find = ''; > } > - > $smarty->assign('find', $find); > - > // Get a list of last changes to the Wiki database > $listpages = $dcslib->list_content($offset, $maxRecords, $sort_mode, $find); > $smarty->assign_by_ref('cant', $listpages['cant']); > $smarty->assign_by_ref('listpages', $listpages["data"]); > ask_ticket('list-contents'); > - > // Display the template > $smarty->assign('mid', 'tiki-list_contents.tpl'); > $smarty->display("tiki.tpl"); > > Modified: trunk/tiki-list_faqs.php > =================================================================== > --- trunk/tiki-list_faqs.php 2009-07-07 17:37:19 UTC (rev 19987) > +++ trunk/tiki-list_faqs.php 2009-07-07 19:01:42 UTC (rev 19988) > @@ -1,134 +1,104 @@ > <?php > - > -// $Id: /cvsroot/tikiwiki/tiki/tiki-list_faqs.php,v 1.18 2007-10-12 07:55:28 nyloth Exp $ > - > -// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. > +// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project > +// > // All Rights Reserved. See copyright.txt for details and a complete list of authors. > // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. > - > -// Initialization > +// $Id: /cvsroot/tikiwiki/tiki/tiki-list_faqs.php,v 1.18 2007-10-12 07:55:28 nyloth Exp $ > $section = 'faqs'; > require_once ('tiki-setup.php'); > - > include_once ('lib/faqs/faqlib.php'); > - > $auto_query_args = array('offset', 'find', 'sort_mode', 'faqId'); > - > if ($prefs['feature_faqs'] != 'y') { > - $smarty->assign('msg', tra("This feature is disabled").": feature_faqs"); > - > + $smarty->assign('msg', tra("This feature is disabled") . ": feature_faqs"); > $smarty->display("error.tpl"); > die; > } > - > if ($tiki_p_view_faqs != 'y') { > $smarty->assign('errortype', 401); > $smarty->assign('msg', tra("You do not have permission to use this feature")); > - > $smarty->display("error.tpl"); > die; > } > - > if (!isset($_REQUEST["faqId"])) { > $_REQUEST["faqId"] = 0; > } > - > $smarty->assign('faqId', $_REQUEST["faqId"]); > - > if ($_REQUEST["faqId"]) { > $info = $tikilib->get_faq($_REQUEST["faqId"]); > } else { > $info = array(); > - > $info["title"] = ''; > $info["description"] = ''; > $info["canSuggest"] = 'n'; > } > - > $smarty->assign('title', $info["title"]); > $smarty->assign('description', $info["description"]); > $smarty->assign('canSuggest', $info["canSuggest"]); > - > if (isset($_REQUEST["remove"])) { > if ($tiki_p_admin_faqs != 'y') { > $smarty->assign('msg', tra("You do not have permission to use this feature")); > $smarty->display("error.tpl"); > die; > } > - $area = 'delfaq'; > - if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > - key_check($area); > + $area = 'delfaq'; > + if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > + key_check($area); > $faqlib->remove_faq($_REQUEST["remove"]); > - } else { > - key_get($area); > - } > + } else { > + key_get($area); > + } > } > - > if (isset($_REQUEST["save"])) { > check_ticket('list-faqs'); > if ($tiki_p_admin_faqs != 'y') { > $smarty->assign('errortype', 401); > $smarty->assign('msg', tra("You do not have permission to use this feature")); > - > $smarty->display("error.tpl"); > die; > } > - > if (isset($_REQUEST["canSuggest"]) && $_REQUEST["canSuggest"] == 'on') { > $canSuggest = 'y'; > } else { > $canSuggest = 'n'; > } > - > $fid = $faqlib->replace_faq($_REQUEST["faqId"], $_REQUEST["title"], $_REQUEST["description"], $canSuggest); > - > $cat_type = 'faq'; > $cat_objid = $fid; > $cat_desc = substr($_REQUEST["description"], 0, 200); > $cat_name = $_REQUEST["title"]; > $cat_href = "tiki-view_faq.php?faqId=" . $cat_objid; > include_once ("categorize.php"); > - > $smarty->assign('faqId', 0); > $smarty->assign('title', ''); > $smarty->assign('description', ''); > $smarty->assign('canSuggest', ''); > } > - > if (!isset($_REQUEST["sort_mode"])) { > $sort_mode = 'created_desc'; > } else { > $sort_mode = $_REQUEST["sort_mode"]; > } > - > if (!isset($_REQUEST["offset"])) { > $offset = 0; > } else { > $offset = $_REQUEST["offset"]; > } > - > $smarty->assign_by_ref('offset', $offset); > - > if (isset($_REQUEST["find"])) { > $find = $_REQUEST["find"]; > } else { > $find = ''; > } > - > $smarty->assign('find', $find); > - > $smarty->assign_by_ref('sort_mode', $sort_mode); > $channels = $tikilib->list_faqs($offset, $maxRecords, $sort_mode, $find); > - > $smarty->assign_by_ref('channels', $channels["data"]); > $smarty->assign_by_ref('cant', $channels["cant"]); > $cat_type = 'faq'; > $cat_objid = $_REQUEST["faqId"]; > include_once ("categorize_list.php"); > - > include_once ('tiki-section_options.php'); > ask_ticket('list-faqs'); > - > // Display the template > $smarty->assign('mid', 'tiki-list_faqs.tpl'); > $smarty->display("tiki.tpl"); > > Modified: trunk/tiki-list_file_gallery.php > =================================================================== > --- trunk/tiki-list_file_gallery.php 2009-07-07 17:37:19 UTC (rev 19987) > +++ trunk/tiki-list_file_gallery.php 2009-07-07 19:01:42 UTC (rev 19988) > @@ -1,90 +1,51 @@ > <?php > - > -// $Id: /cvsroot/tikiwiki/tiki/tiki-list_file_gallery.php,v 1.50.2.14 2008-03-16 00:06:53 nyloth Exp $ > - > -// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. > +// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project > +// > // All Rights Reserved. See copyright.txt for details and a complete list of authors. > // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. > - > -// Initialization > +// $Id: /cvsroot/tikiwiki/tiki/tiki-list_file_gallery.php,v 1.50.2.14 2008-03-16 00:06:53 nyloth Exp $ > $section = 'file_galleries'; > -require_once('tiki-setup.php'); > - > -if ( $prefs['feature_file_galleries'] != 'y' ) { > - $smarty->assign('msg', tra('This feature is disabled').': feature_file_galleries'); > +require_once ('tiki-setup.php'); > +if ($prefs['feature_file_galleries'] != 'y') { > + $smarty->assign('msg', tra('This feature is disabled') . ': feature_file_galleries'); > $smarty->display('error.tpl'); > die; > } > include_once ('lib/filegals/filegallib.php'); > include_once ('lib/stats/statslib.php'); > -if ( $prefs['feature_categories'] == 'y' ) { > - global $categlib; include_once('lib/categories/categlib.php'); > +if ($prefs['feature_categories'] == 'y') { > + global $categlib; > + include_once ('lib/categories/categlib.php'); > } > if ($prefs['feature_groupalert'] == 'y') { > include_once ('lib/groupalert/groupalertlib.php'); > } > - > -$auto_query_args = array('galleryId','fileId','offset','find','sort_mode','edit_mode','page','filegals_manager','maxRecords','show_fgalexplorer','dup_mode','show_details','view'); > - > +$auto_query_args = array('galleryId', 'fileId', 'offset', 'find', 'sort_mode', 'edit_mode', 'page', 'filegals_manager', 'maxRecords', 'show_fgalexplorer', 'dup_mode', 'show_details', 'view'); > $gal_info = ''; > -if ( ! isset($_REQUEST['galleryId']) || $_REQUEST['galleryId'] == 0 ) { > +if (!isset($_REQUEST['galleryId']) || $_REQUEST['galleryId'] == 0) { > $tikilib->get_perm_object('', 'file gallery'); > $_REQUEST['galleryId'] = 0; > - > - // Initialize listing fields with default values (used for the main gallery listing) > - $gal_info = array( > - 'name' => '', > - 'show_id' => $prefs['fgal_list_id'], > - 'show_icon' => $prefs['fgal_list_type'], > - 'show_name' => 'f', //$prefs['fgal_list_name'], > - 'show_description' => $prefs['fgal_list_description'], > - 'show_size' => $prefs['fgal_list_size'], > - 'show_created' => $prefs['fgal_list_created'], > - 'show_modified' => $prefs['fgal_list_lastmodif'], > - 'show_creator' => $prefs['fgal_list_creator'], > - 'show_author' => $prefs['fgal_list_author'], > - 'show_last_user' => $prefs['fgal_list_last_user'], > - 'show_comment' => $prefs['fgal_list_comment'], > - 'show_files' => $prefs['fgal_list_files'], > - 'show_explorer' => $prefs['fgal_show_explorer'], > - 'show_path' => $prefs['fgal_show_path'], > - 'show_slideshow' => $prefs['fgal_show_slideshow'], > - 'default_view' => $prefs['fgal_default_view'], > - 'show_hits' => $prefs['fgal_list_hits'], > - 'show_lockedby' => $prefs['fgal_list_lockedby'], > - 'show_checked' => 'y', > - 'show_userlink' => 'y', > - 'sort_mode' => $prefs['fgal_sort_mode'], > - 'public' => 'y', > - 'lockable' => 'n', > - 'visible' =>'y', > - 'archives' => -1, > - 'type' => 'default', > - 'description' => '', > - ); > -} elseif ( $gal_info = $tikilib->get_file_gallery($_REQUEST['galleryId']) ) { > + // Initialize listing fields with default values (used for the main gallery listing) > + $gal_info = array('name' => '', 'show_id' => $prefs['fgal_list_id'], 'show_icon' => $prefs['fgal_list_type'], 'show_name' => 'f', //$prefs['fgal_list_name'], > + 'show_description' => $prefs['fgal_list_description'], 'show_size' => $prefs['fgal_list_size'], 'show_created' => $prefs['fgal_list_created'], 'show_modified' => $prefs['fgal_list_lastmodif'], 'show_creator' => $prefs['fgal_list_creator'], 'show_author' => $prefs['fgal_list_author'], 'show_last_user' => $prefs['fgal_list_last_user'], 'show_comment' => $prefs['fgal_list_comment'], 'show_files' => $prefs['fgal_list_files'], 'show_explorer' => $prefs['fgal_show_explorer'], 'show_path' => $prefs['fgal_show_path'], 'show_slideshow' => $prefs['fgal_show_slideshow'], 'default_view' => $prefs['fgal_default_view'], 'show_hits' => $prefs['fgal_list_hits'], 'show_lockedby' => $prefs['fgal_list_lockedby'], 'show_checked' => 'y', 'show_userlink' => 'y', 'sort_mode' => $prefs['fgal_sort_mode'], 'public' => 'y', 'lockable' => 'n', 'visible' => 'y', 'archives' => - 1, 'type' => 'default', 'description' => '',); > +} elseif ($gal_info = $tikilib->get_file_gallery($_REQUEST['galleryId'])) { > $tikilib->get_perm_object($_REQUEST['galleryId'], 'file gallery', $gal_info); > if ($userlib->object_has_one_permission($_REQUEST['galleryId'], 'file gallery')) { > $smarty->assign('individual', 'y'); > } > $podCastGallery = $filegallib->isPodCastGallery($_REQUEST['galleryId'], $gal_info); > - > } else { > $smarty->assign('msg', tra('Non-existent gallery')); > $smarty->display('error.tpl');... [truncated message content] |