Commit a5cad7d5 authored by rjsmelo's avatar rjsmelo

[REF] Reformat code

parent c7a785ac
......@@ -3,18 +3,18 @@
* @package tikiwiki
*/
// (c) Copyright 2002-2016 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$
$section = 'forums';
require_once ('tiki-setup.php');
require_once('tiki-setup.php');
$access->check_feature('feature_forums');
// forumId must be received
if (!isset($_REQUEST["forumId"])) {
if (! isset($_REQUEST["forumId"])) {
$smarty->assign('msg', tra("No forum indicated"));
$smarty->display("error.tpl");
die;
......@@ -43,12 +43,12 @@ if ($user) {
$access->check_permission('tiki_p_admin_forum');
$smarty->assign_by_ref('forum_info', $forum_info);
include_once ('tiki-section_options.php');
include_once('tiki-section_options.php');
if ($prefs['feature_theme_control'] == 'y') {
$cat_type = 'forum';
$cat_objid = $_REQUEST["forumId"];
include ('tiki-tc.php');
include('tiki-tc.php');
}
if (isset($_REQUEST['qId'])) {
......@@ -61,7 +61,7 @@ $smarty->assign('form', 'y');
if (isset($_REQUEST['del']) && isset($_REQUEST['msg'])) {
check_ticket('forum-reported');
foreach (array_keys($_REQUEST['msg'])as $msg) {
foreach (array_keys($_REQUEST['msg']) as $msg) {
$commentslib->remove_reported($msg);
}
}
......@@ -69,11 +69,11 @@ if (isset($_REQUEST['del']) && isset($_REQUEST['msg'])) {
// Quickjumpt to other forums
if ($tiki_p_admin_forum == 'y' || $prefs['feature_forum_quickjump'] == 'y') {
$all_forums = $commentslib->list_forums(0, -1, 'name_asc', '');
Perms::bulk(array( 'type' => 'forum' ), 'object', $all_forums['data'], 'forumId');
Perms::bulk([ 'type' => 'forum' ], 'object', $all_forums['data'], 'forumId');
$temp_max = count($all_forums["data"]);
for ($i = 0; $i < $temp_max; $i++) {
$forumperms = Perms::get(array( 'type' => 'forum', 'object' => $options['data'][$i]['forumId'] ));
$forumperms = Perms::get([ 'type' => 'forum', 'object' => $options['data'][$i]['forumId'] ]);
$all_forums["data"][$i]["can_read"] = $forumperms->forum_read ? 'y' : 'n';
}
......@@ -86,13 +86,13 @@ if ($tiki_p_admin_forum == 'y') {
}
// Items will contain messages
if (!isset($_REQUEST["sort_mode"])) {
if (! isset($_REQUEST["sort_mode"])) {
$sort_mode = 'timestamp_desc';
} else {
$sort_mode = $_REQUEST["sort_mode"];
}
if (!isset($_REQUEST["offset"])) {
if (! isset($_REQUEST["offset"])) {
$offset = 0;
} else {
$offset = $_REQUEST["offset"];
......
......@@ -8,31 +8,31 @@
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
require_once ('tiki-setup.php');
require_once('tiki-setup.php');
$rsslib = TikiLib::lib('rss');
$access->check_feature('feature_forums');
if ($prefs['feed_forums'] != 'y') {
$errmsg=tra("rss feed disabled");
require_once ('tiki-rss_error.php');
$errmsg = tra("rss feed disabled");
require_once('tiki-rss_error.php');
}
$res=$access->authorize_rss(array('tiki_p_admin_forum','tiki_p_forum_read'));
$res = $access->authorize_rss(['tiki_p_admin_forum','tiki_p_forum_read']);
if ($res) {
if ($res['header'] == 'y') {
header('WWW-Authenticate: Basic realm="'.$tikidomain.'"');
header('WWW-Authenticate: Basic realm="' . $tikidomain . '"');
header('HTTP/1.0 401 Unauthorized');
}
$errmsg=$res['msg'];
require_once ('tiki-rss_error.php');
$errmsg = $res['msg'];
require_once('tiki-rss_error.php');
}
$feed = "forums";
$uniqueid = $feed;
$output = $rsslib->get_from_cache($uniqueid);
if ($output["data"]=="EMPTY") {
if ($output["data"] == "EMPTY") {
$title = $prefs['feed_forums_title'];
$desc = $prefs['feed_forums_desc'];
$id = 'object';
......@@ -46,5 +46,5 @@ if ($output["data"]=="EMPTY") {
$changes = $tikilib ->list_recent_forum_topics($prefs['feed_forums_max']);
$output = $rsslib->generate_feed($feed, $uniqueid, '', $changes, $readrepl, $param, $id, $title, $titleId, $desc, $descId, $dateId, $authorId);
}
header("Content-type: ".$output["content-type"]);
header("Content-type: " . $output["content-type"]);
print $output["data"];
<?php
// (c) Copyright 2002-2016 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$
require_once ('tiki-setup.php');
$access->check_feature(array('feature_freetags','freetags_multilingual','feature_multilingual'));
require_once('tiki-setup.php');
$access->check_feature(['feature_freetags','freetags_multilingual','feature_multilingual']);
$access->check_permission('tiki_p_freetags_tag');
if ( !isset($_REQUEST['type']))
if (! isset($_REQUEST['type'])) {
$_REQUEST['type'] = 'wiki page';
if ( !isset($_REQUEST['objId']))
}
if (! isset($_REQUEST['objId'])) {
$_REQUEST['objId'] = '';
}
$cat_type = $_REQUEST['type'];
$cat_objId = $_REQUEST['objId'];
......@@ -26,7 +28,7 @@ if ($cat_type != 'wiki page' && $cat_type != 'article') {
$freetaglib = TikiLib::lib('freetag');
$multilinguallib = TikiLib::lib('multilingual');
if ( $cat_objId ) {
if ($cat_objId) {
$info = $tikilib->get_page_info($cat_objId);
} elseif (false&&$tiki_p_admin_freetags != 'y') {
// Global tag edit only available to admins
......@@ -41,39 +43,47 @@ $smarty->assign('objId', $cat_objId);
$smarty->assign('data', $info);
if ( isset($_REQUEST['save']) ) {
if (isset($_REQUEST['save'])) {
// Process save
if ( isset($_REQUEST['setlang']) && is_array($_REQUEST['setlang']) ) {
foreach ( $_REQUEST['setlang'] as $tagId => $lang )
if ( !empty($lang) )
if (isset($_REQUEST['setlang']) && is_array($_REQUEST['setlang'])) {
foreach ($_REQUEST['setlang'] as $tagId => $lang) {
if (! empty($lang)) {
$freetaglib->set_tag_language($tagId, $lang);
}
}
}
if ( isset($_REQUEST['newtag'])
if (isset($_REQUEST['newtag'])
&& isset($_REQUEST['rootlang'])
&& is_array($_REQUEST['newtag'])
&& is_array($_REQUEST['rootlang']) ) {
foreach ( $_REQUEST['newtag'] as $tagGroup => $list )
if ( is_array($list) && array_key_exists($tagGroup, $_REQUEST['rootlang']) )
foreach ( $list as $lang => $tag ) {
foreach ($_REQUEST['newtag'] as $tagGroup => $list) {
if (is_array($list) && array_key_exists($tagGroup, $_REQUEST['rootlang'])) {
foreach ($list as $lang => $tag) {
$root = $_REQUEST['rootlang'][$tagGroup];
if ( !array_key_exists($lang, $root) )
if (! array_key_exists($lang, $root)) {
continue;
}
$freetaglib->translate_tag($root[$lang], $tagGroup, $lang, $tag);
}
}
}
}
if ( isset( $_REQUEST['clear'] ) && is_array($_REQUEST['clear']) ) {
foreach ( $_REQUEST['clear'] as $tag )
if (isset($_REQUEST['clear']) && is_array($_REQUEST['clear'])) {
foreach ($_REQUEST['clear'] as $tag) {
$freetaglib->clear_tag_language_from_id($tag);
}
}
} else {
// Form reload
if ( isset($_REQUEST['newtag']) )
if (isset($_REQUEST['newtag'])) {
$smarty->assign('newtags', $_REQUEST['newtag']);
if ( isset($_REQUEST['setlang']) )
}
if (isset($_REQUEST['setlang'])) {
$smarty->assign('setlang', $_REQUEST['setlang']);
}
}
$freetags_per_page = $prefs['maxRecords'];
......@@ -85,19 +95,22 @@ $smarty->assign('freetags_offset', $offset);
$smarty->assign('freetags_per_page', $freetags_per_page);
$languages = $multilinguallib->preferredLangs();
$used_languages = array();
foreach ($languages as $l)
$used_languages = [];
foreach ($languages as $l) {
$used_languages[$l] = true;
if ( array_key_exists('additional_languages', $_REQUEST)
&& is_array($_REQUEST['additional_languages']) )
foreach ( $_REQUEST['additional_languages'] as $lang )
}
if (array_key_exists('additional_languages', $_REQUEST)
&& is_array($_REQUEST['additional_languages']) ) {
foreach ($_REQUEST['additional_languages'] as $lang) {
$used_languages[$lang] = true;
}
}
$used_languages = array_keys($used_languages);
$langLib = TikiLib::lib('language');
$allLanguages = $langLib->list_languages();
// select roughly readable languages
$t_used_languages = array();
$t_used_languages = [];
foreach ($allLanguages as $al) {
foreach ($used_languages as $ul) {
if (substr($al["value"], 0, 2) == substr($ul, 0, 2)) {
......@@ -110,31 +123,32 @@ $used_languages = $t_used_languages;
$tagList = $freetaglib->get_object_tags_multilingual($cat_type, $cat_objId, $used_languages, $offset, $freetags_per_page);
$rootlangs = array();
foreach ( $tagList as $tagGroup ) {
foreach ( $tagGroup as $k => $tag ) {
array_merge($used_languages, array($k));
if ( $tag['tagset'] == $tag['tagId'] )
$rootlangs = [];
foreach ($tagList as $tagGroup) {
foreach ($tagGroup as $k => $tag) {
array_merge($used_languages, [$k]);
if ($tag['tagset'] == $tag['tagId']) {
$rootlangs[$tag['tagset']] = $tag['lang'];
}
}
}
$baseArgs = array(
$baseArgs = [
'type' => $cat_type,
'objId' => $cat_objId,
'additional_languages' => $used_languages,
);
];
$prev = http_build_query(array_merge($baseArgs, array( 'offset' => $offset - $freetags_per_page )), '', '&');
$next = http_build_query(array_merge($baseArgs, array( 'offset' => $offset + $freetags_per_page )), '', '&');
$prev = http_build_query(array_merge($baseArgs, [ 'offset' => $offset - $freetags_per_page ]), '', '&');
$next = http_build_query(array_merge($baseArgs, [ 'offset' => $offset + $freetags_per_page ]), '', '&');
$smarty->assign('next', 'tiki-freetag_translate.php?' . $next);
if ( $offset ) {
if ($offset) {
$smarty->assign('previous', 'tiki-freetag_translate.php?' . $prev);
} else {
$smarty->assign('previous', '');
}
$smarty->assign('tagList', $tagList);
$smarty->assign('languageList', $used_languages);
$smarty->assign('fullLanguageList', $allLanguages);
......
......@@ -6,7 +6,7 @@
// $Id$
$section = 'galleries';
require_once ('tiki-setup.php');
require_once('tiki-setup.php');
$imagegallib = TikiLib::lib('imagegal');
$categlib = TikiLib::lib('categ');
......@@ -21,7 +21,7 @@ if (isset($_REQUEST['find'])) {
$smarty->assign('find', $find);
if (!isset($_REQUEST['galleryId'])) {
if (! isset($_REQUEST['galleryId'])) {
$_REQUEST['galleryId'] = 0;
}
......@@ -45,25 +45,55 @@ if (isset($_REQUEST['migrate_images_to_fgal'])) {
$foo = parse_url($_SERVER['REQUEST_URI']);
$foo['path'] = str_replace('tiki-galleries', 'tiki-browse_gallery', $foo['path']);
$smarty->assign('url', $tikilib->httpPrefix(). $foo['path']);
$smarty->assign('url', $tikilib->httpPrefix() . $foo['path']);
if (!isset($_REQUEST['maxRows'])) $_REQUEST['maxRows'] = $prefs['maxRowsGalleries'];
if (!isset($_REQUEST['rowImages'])) $_REQUEST['rowImages'] = $prefs['rowImagesGalleries'];
if (!isset($_REQUEST['thumbSizeX'])) $_REQUEST['thumbSizeX'] = $prefs['thumbSizeXGalleries'];
if (!isset($_REQUEST['thumbSizeY'])) $_REQUEST['thumbSizeY'] = $prefs['thumbSizeYGalleries'];
if (!isset($_REQUEST['scaleSize'])) $_REQUEST['scaleSize'] = $prefs['scaleSizeGalleries'];
if (! isset($_REQUEST['maxRows'])) {
$_REQUEST['maxRows'] = $prefs['maxRowsGalleries'];
}
if (! isset($_REQUEST['rowImages'])) {
$_REQUEST['rowImages'] = $prefs['rowImagesGalleries'];
}
if (! isset($_REQUEST['thumbSizeX'])) {
$_REQUEST['thumbSizeX'] = $prefs['thumbSizeXGalleries'];
}
if (! isset($_REQUEST['thumbSizeY'])) {
$_REQUEST['thumbSizeY'] = $prefs['thumbSizeYGalleries'];
}
if (! isset($_REQUEST['scaleSize'])) {
$_REQUEST['scaleSize'] = $prefs['scaleSizeGalleries'];
}
if (isset($_REQUEST['edit']) || isset($_REQUEST['preview']) || $_REQUEST['galleryId'] == 0) {
if (!isset($_REQUEST['description'])) $_REQUEST['description'] = '';
if (!isset($_REQUEST['maxRows'])) $_REQUEST['maxRows'] = 10;
if (!isset($_REQUEST['rowImages'])) $_REQUEST['rowImages'] = 6;
if (!isset($_REQUEST['thumbSizeX'])) $_REQUEST['thumbSizeX'] = 80;
if (!isset($_REQUEST['thumbSizeY'])) $_REQUEST['thumbSizeY'] = 80;
if (!isset($_REQUEST['sortorder'])) $_REQUEST['sortorder'] = 'created';
if (!isset($_REQUEST['sortdirection'])) $_REQUEST['sortdirection'] = 'desc';
if (!isset($_REQUEST['galleryimage'])) $_REQUEST['galleryimage'] = 'first';
if (!isset($_REQUEST['parentgallery'])) $_REQUEST['parentgallery'] = -1;
if (!isset($_REQUEST['defaultscale'])) $_REQUEST['defaultscale'] = 'o';
if (! isset($_REQUEST['description'])) {
$_REQUEST['description'] = '';
}
if (! isset($_REQUEST['maxRows'])) {
$_REQUEST['maxRows'] = 10;
}
if (! isset($_REQUEST['rowImages'])) {
$_REQUEST['rowImages'] = 6;
}
if (! isset($_REQUEST['thumbSizeX'])) {
$_REQUEST['thumbSizeX'] = 80;
}
if (! isset($_REQUEST['thumbSizeY'])) {
$_REQUEST['thumbSizeY'] = 80;
}
if (! isset($_REQUEST['sortorder'])) {
$_REQUEST['sortorder'] = 'created';
}
if (! isset($_REQUEST['sortdirection'])) {
$_REQUEST['sortdirection'] = 'desc';
}
if (! isset($_REQUEST['galleryimage'])) {
$_REQUEST['galleryimage'] = 'first';
}
if (! isset($_REQUEST['parentgallery'])) {
$_REQUEST['parentgallery'] = -1;
}
if (! isset($_REQUEST['defaultscale'])) {
$_REQUEST['defaultscale'] = 'o';
}
}
......@@ -84,14 +114,14 @@ $smarty->assign('owner', $user);
$smarty->assign('geographic', 'n');
$smarty->assign('edit_mode', 'n');
$options_sortorder = array(
$options_sortorder = [
tra('id') => 'imageId',
tra('Name') => 'name',
tra('Creation Date') => 'created',
tra('Owner') => 'user',
tra('Hits') => 'hits',
tra('Size') => 'filesize'
);
];
$smarty->assign_by_ref('options_sortorder', $options_sortorder);
$smarty->assign('sortorder', 'imageId');
......@@ -108,20 +138,20 @@ $smarty->assign('showxysize', 'n');
$smarty->assign('showfilesize', 'n');
$smarty->assign('showfilename', 'n');
$options_galleryimage = array(
$options_galleryimage = [
tra('first uploaded image') => 'firstu',
tra('last uploaded image') => 'lastu',
tra('first image') => 'first',
tra('last image') => 'last',
tra('random image') => 'random'
);
];
$smarty->assign_by_ref('options_galleryimage', $options_galleryimage);
$smarty->assign('galleryimage', 'first');
$galleries_list=$imagegallib->list_galleries(0, -1, 'name_desc', $user);
$galleries_list = $imagegallib->list_galleries(0, -1, 'name_desc', $user);
$smarty->assign_by_ref('galleries_list', $galleries_list['data']);
$smarty->assign('defaultscale', 'o');
$smarty->assign('scaleinfo', array());
$smarty->assign('scaleinfo', []);
$smarty->assign('parentgallery', -1);
// If we are editing an existing gallery prepare smarty variables
......@@ -158,7 +188,8 @@ if (isset($_REQUEST['edit_mode']) && $_REQUEST['edit_mode']) {
$smarty->assign('parentgallery', $info['parentgallery']);
$smarty->assign('showname', $info['showname']);
$smarty->assign('showimageid', $info['showimageid']);
$smarty->assign('showcategories', $info['showcategories']);;
$smarty->assign('showcategories', $info['showcategories']);
;
$smarty->assign('showdescription', $info['showdescription']);
$smarty->assign('showcreated', $info['showcreated']);
$smarty->assign('showuser', $info['showuser']);
......@@ -199,7 +230,7 @@ if (isset($_REQUEST['edit'])
if ($_REQUEST['galleryId'] > 0) {
$info = $imagegallib->get_gallery_info($_REQUEST['galleryId']);
if (!$user || $info['user'] != $user) {
if (! $user || $info['user'] != $user) {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra('You do not have permission to edit this gallery'));
......@@ -225,7 +256,7 @@ if (isset($_REQUEST['edit'])
$smarty->assign('parentgallery', $_REQUEST['parentgallery']);
$smarty->assign('defaultscale', $_REQUEST['defaultscale']);
$auxarray = array(
$auxarray = [
'showname',
'showimageid',
'showdescription',
......@@ -236,10 +267,10 @@ if (isset($_REQUEST['edit'])
'showfilesize',
'showfilename',
'showcategories'
);
];
foreach ($auxarray as $key => $item) {
if (!isset($_REQUEST[$item])) {
if (! isset($_REQUEST[$item])) {
$_REQUEST[$item] = 'n';
}
$smarty->assign($item, $_REQUEST[$item]);
......@@ -325,8 +356,8 @@ if (isset($_REQUEST['edit'])
$cat_desc = substr($_REQUEST['description'], 0, 200);
$cat_name = $_REQUEST['name'];
$cat_href = 'tiki-browse_gallery.php?galleryId=' . $cat_objid;
include_once ('categorize.php');
include_once ('freetag_apply.php');
include_once('categorize.php');
include_once('freetag_apply.php');
$smarty->assign('edit_mode', 'n');
$smarty->assign('galleryId', '');
......@@ -346,7 +377,7 @@ if ($category_needed == 'y') {
$smarty->assign('parentgallery', $_REQUEST['parentgallery']);
$smarty->assign('defaultscale', $_REQUEST['defaultscale']);
$auxarray = array(
$auxarray = [
'showname',
'showimageid',
'showdescription',
......@@ -357,11 +388,11 @@ if ($category_needed == 'y') {
'showfilesize',
'showfilename',
'showcategories'
);
];
foreach ($auxarray as $key => $item) {
if (!isset($_REQUEST[$item])) {
$_REQUEST[$item]='n';
if (! isset($_REQUEST[$item])) {
$_REQUEST[$item] = 'n';
}
$smarty->assign($item, $_REQUEST[$item]);
}
......@@ -393,7 +424,7 @@ if (isset($_REQUEST['removegal'])) {
if ($tiki_p_admin_galleries != 'y') {
$info = $imagegallib->get_gallery_info($_REQUEST['removegal']);
if (!$user || $info['user'] != $user) {
if (! $user || $info['user'] != $user) {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra('You do not have permission to remove this gallery'));
......@@ -406,7 +437,7 @@ if (isset($_REQUEST['removegal'])) {
}
$smarty->assign('category_needed', $category_needed);
if (!isset($_REQUEST['sort_mode'])) {
if (! isset($_REQUEST['sort_mode'])) {
$sort_mode = 'name_asc';
} else {
$sort_mode = $_REQUEST['sort_mode'];
......@@ -414,7 +445,7 @@ if (!isset($_REQUEST['sort_mode'])) {
$smarty->assign_by_ref('sort_mode', $sort_mode);
if (!isset($_REQUEST['offset'])) {
if (! isset($_REQUEST['offset'])) {
$offset = 0;
} else {
$offset = $_REQUEST['offset'];
......@@ -426,20 +457,21 @@ $smarty->assign_by_ref('offset', $offset);
$imagegallib = TikiLib::lib('imagegal');
$galleries = $imagegallib->list_galleries($offset, $maxRecords, $sort_mode, 'admin', $find);
Perms::bulk(array( 'type' => 'image gallery' ), 'object', $galleries, 'galleryId');
Perms::bulk([ 'type' => 'image gallery' ], 'object', $galleries, 'galleryId');
$smarty->assign('filter', '');
if (!empty($_REQUEST['filter']))
$smarty->assign('filter', $_REQUEST['filter']);
if (! empty($_REQUEST['filter'])) {
$smarty->assign('filter', $_REQUEST['filter']);
}
$temp_max = count($galleries['data']);
for ($i = 0; $i < $temp_max; $i++) {
$galperms = Perms::get(
array(
[
'type' => 'image gallery',
'object' => $galleries['data'][$i]['galleryId']
)
]
);
// check if top gallery (has no parents)
......@@ -477,12 +509,12 @@ $smarty->assign_by_ref('cant', $galleries['cant']);
$cat_type = 'image gallery';
$cat_objid = $_REQUEST['galleryId'];
include_once ('categorize_list.php');
include_once ('freetag_list.php');
include_once('categorize_list.php');
include_once('freetag_list.php');
$defaultRows = 5;
include_once ('tiki-section_options.php');
include_once('tiki-section_options.php');
ask_ticket('galleries');
$perms = Perms::get();
......
......@@ -3,35 +3,35 @@
* @package tikiwiki
*/
// (c) Copyright 2002-2016 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$
$section = 'galleries';
require_once ('tiki-setup.php');
include_once ('lib/rankings/ranklib.php');
$access->check_feature(array('feature_galleries','feature_gal_rankings'));
require_once('tiki-setup.php');
include_once('lib/rankings/ranklib.php');
$access->check_feature(['feature_galleries','feature_gal_rankings']);
$access->check_permission('tiki_p_list_image_galleries');
$allrankings = array(
array(
$allrankings = [
[
'name' => tra('Top galleries'),
'value' => 'gal_ranking_top_galleries'
),
array(
],
[
'name' => tra('Top images'),
'value' => 'gal_ranking_top_images'
),
array(
],
[
'name' => tra('Last images'),
'value' => 'gal_ranking_last_images'
),
);
],
];
$smarty->assign('allrankings', $allrankings);
if (!isset($_REQUEST["which"])) {
if (! isset($_REQUEST["which"])) {
$which = 'gal_ranking_top_galleries';
} else {
$which = $_REQUEST["which"];
......@@ -40,7 +40,7 @@ if (!isset($_REQUEST["which"])) {
$smarty->assign('which', $which);
// Get the page from the request var or default it to HomePage
if (!isset($_REQUEST["limit"])) {
if (! isset($_REQUEST["limit"])) {
$limit = 10;
} else {
$limit = $_REQUEST["limit"];
......@@ -52,7 +52,7 @@ $smarty->assign_by_ref('limit', $limit);
// Top Pages
// Last pages
// Top Authors
$rankings = array();
$rankings = [];
$rk = $ranklib->$which($limit);
$rank["data"] = $rk["data"];
......@@ -64,7 +64,7 @@ $rankings[] = $rank;
$smarty->assign_by_ref('rankings', $rankings);
$smarty->assign('rpage', 'tiki-galleries_rankings.php');
include_once ('tiki-section_options.php');
include_once('tiki-section_options.php');
ask_ticket('galleries-rankings');
// Display the template
......
......@@ -3,7 +3,7 @@
* @package tikiwiki
*/
// (c) Copyright 2002-2016 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$
......@@ -14,7 +14,7 @@ require_once('lib/graph-engine/graph.bar.php');
$access->check_feature('wikiplugin_gdgraph');
//Decode the passed array
//Decode the passed array
$strencxy2 = $_GET['usexydata'];
$dataxy = json_decode(urldecode($strencxy2));
......@@ -24,7 +24,7 @@ if ($_REQUEST["type"] == 'barvert' || $_REQUEST["type"] == 'barhoriz') {
$graph = new MultibarGraphic;
$graph->setTitle(tra($_REQUEST["title"]));
$graph->setData(array('x' => $dataxy->xdata, 'y0' => $dataxy->ydata));
$graph->setData(['x' => $dataxy->xdata, 'y0' => $dataxy->ydata]);
if ($_REQUEST["type"] == 'barvert') {
$graph->setParam('grid-independant-location', 'horizontal');
......@@ -34,31 +34,28 @@ if ($_REQUEST["type"] == 'barvert' || $_REQUEST["type"] == 'barhoriz') {
}
$graph->setParam('grid-independant-major-font', 'Normal-Text');
$graph->setParam('grid-independant-major-guide', false);
} elseif ($_REQUEST["type"] == 'multiline') {
// multiline not working as yet so shouldn't get here
$renderer = new GD_GRenderer($_REQUEST["width"], $_REQUEST["height"]);
$graph = new MultilineGraphic;
$graph->setTitle(tra($_REQUEST["title"]));
$graph->setData(array('x' => $dataxy['xdata'], 'y0' => $dataxy['ydata']));
$graph-><