Commit 37862b08 authored by changi67's avatar changi67
parent 9c8fcc5d
......@@ -30,7 +30,7 @@ if (!isset($_REQUEST["id"])) {
$useCache = isset($_REQUEST['cache']) && $_REQUEST['cache'] == 'y'; // cache only the image in list mode
// If image_type has no value, we default to "article" to preserve previous behaviour
if(!isset($_REQUEST["image_type"])) {
if (!isset($_REQUEST["image_type"])) {
$_REQUEST["image_type"]="article";
}
......
......@@ -20,11 +20,11 @@ $smarty->assign('mandatory_category', '-1');
if ($prefs['feature_categories'] == 'y' && isset($cat_type) && isset($cat_objid)) {
$categlib = TikiLib::lib('categ');
if( ! isset( $cat_object_exists ) ) {
if ( ! isset( $cat_object_exists ) ) {
$cat_object_exists = (bool) $cat_objid;
}
if( $cat_object_exists ) {
if ( $cat_object_exists ) {
$cats = $categlib->get_object_categories($cat_type, $cat_objid);
} else {
$cats = $categlib->get_default_categories();
......
......@@ -147,7 +147,7 @@ if (!isset($comments_prefix_var)) {
$comments_prefix_var = '';
}
if( ! isset( $comments_objectId ) ) {
if ( ! isset( $comments_objectId ) ) {
if (!isset($_REQUEST[$comments_object_var])) {
die ("The comments_object_var variable cannot be found as a REQUEST variable");
}
......@@ -192,7 +192,7 @@ if ( isset($_REQUEST['comments_objectId']) && $_REQUEST['comments_objectId'] ==
$smarty->assign_by_ref('errors', $errors);
$smarty->assign_by_ref('feedbacks', $feedbacks);
if( isset( $pageCache ) ) {
if ( isset( $pageCache ) ) {
$pageCache->invalidate();
}
}
......@@ -235,10 +235,10 @@ if ($_REQUEST["comments_threadId"] > 0) {
$comment_info["data"] = "\n> " . $comment_info["data"];
}
}
$smarty->assign( 'comment_data', $comment_info["data"] );
$smarty->assign('comment_data', $comment_info["data"]);
if( ! array_key_exists( "title", $comment_info ) ) {
if( array_key_exists( "comments_title", $_REQUEST ) ) {
if ( ! array_key_exists( "title", $comment_info ) ) {
if ( array_key_exists( "comments_title", $_REQUEST ) ) {
$comment_info["title"] = $_REQUEST["comments_title"];
} else {
$comment_info["title"] = "";
......@@ -320,7 +320,7 @@ if ($forum_check[0] == 'forum' ) {
$smarty->assign('forumId', $forum_check[1]);
}
if( isset( $_REQUEST["comments_grandParentId"] ) ) {
if ( isset( $_REQUEST["comments_grandParentId"] ) ) {
$smarty->assign('comments_grandParentId', $_REQUEST["comments_grandParentId"]);
}
......@@ -330,7 +330,7 @@ else
$threadId_if_reply = 0;
if (empty($thread_sort_mode)) {
if( !empty($_REQUEST['thread_sort_mode'])) {
if ( !empty($_REQUEST['thread_sort_mode'])) {
$thread_sort_mode = $_REQUEST['thread_sort_mode'];
} else {
$thread_sort_mode = 'commentDate_asc';
......@@ -355,7 +355,7 @@ $smarty->assign('comments_cant', $comments_cant);
// Offset management
$comments_maxRecords = $comments_per_page;
if( $comments_maxRecords != 0 ) {
if ( $comments_maxRecords != 0 ) {
$comments_cant_pages = ceil($comments_cant_page / $comments_maxRecords);
$smarty->assign('comments_actual_page', 1 + ($comments_offset / $comments_maxRecords));
} else {
......
......@@ -58,7 +58,7 @@ if (isset($_POST['adddata'])) {
if (!empty($_REQUEST["offset"])) {
$_SESSION["customsearch_$id"]["offset"] = $_REQUEST["offset"];
}
foreach($adddata as $fieldid => $d) {
foreach ($adddata as $fieldid => $d) {
$config = $d['config'];
$name = $d['name'];
$value = $d['value'];
......@@ -125,7 +125,7 @@ echo $results;
function cs_get_grouped($dataappend, $groups) {
$grouped = array();
foreach($dataappend as $fieldid => $data) {
foreach ($dataappend as $fieldid => $data) {
if (isset($groups[$fieldid]) && !isset($groupedids[$groups[$fieldid]])) {
$grouped[$groups[$fieldid]] = array_keys($groups, $groups[$fieldid]);
}
......
......@@ -37,7 +37,7 @@ if ($prefs['feature_freetags'] == 'y' and $tiki_p_view_freetags == 'y') {
$taglist = '';
}
if( !isset($cat_lang))
if ( !isset($cat_lang))
$cat_lang = null;
$suggestion = $freetaglib->get_tag_suggestion($taglist,$prefs['freetags_browse_amount_tags_suggestion'],$cat_lang);
......
......@@ -15,7 +15,7 @@ $maxRecords = $messulib->get_user_preference($user, 'maxRecords', 20);
// Delete messages if the delete button was pressed
if (isset($_REQUEST["delete"]) && isset($_REQUEST["msg"])) {
check_ticket('messu-archive');
foreach(array_keys($_REQUEST["msg"]) as $msg) {
foreach (array_keys($_REQUEST["msg"]) as $msg) {
$messulib->delete_message($user, $msg, 'archive');
}
}
......@@ -24,7 +24,7 @@ if (isset($_REQUEST["download"])) {
check_ticket('messu-archive');
// if message ids are handed over, use them:
if (isset($_REQUEST["msg"])) {
foreach(array_keys($_REQUEST["msg"]) as $msg) {
foreach (array_keys($_REQUEST["msg"]) as $msg) {
$tmp = $messulib->get_message($user, $msg, 'archive');
$items[] = $tmp;
}
......
......@@ -32,7 +32,7 @@ if (isset($_REQUEST['groupbr'])) {
if ($_REQUEST['groupbr'] == 'all' && $tiki_p_broadcast_all == 'y') {
$a_all_users = $userlib->get_users(0, -1, 'login_desc', '');
$all_users = array();
foreach($a_all_users['data'] as $a_user) {
foreach ($a_all_users['data'] as $a_user) {
$all_users[] = $a_user['user'];
}
} else {
......@@ -55,7 +55,7 @@ if (isset($_REQUEST['send']) || isset($_REQUEST['preview'])) {
}
// Remove invalid users from the to, cc and bcc fields
$users = array();
foreach($all_users as $a_user) {
foreach ($all_users as $a_user) {
if (!empty($a_user)) {
if ($userlib->user_exists($a_user)) {
if (!$userlib->user_has_permission($a_user, 'tiki_p_messages')) {
......@@ -91,7 +91,7 @@ if (isset($_REQUEST['send']) || isset($_REQUEST['preview'])) {
if (isset($_REQUEST['send'])) {
$smarty->assign('sent', 1);
// Insert the message in the inboxes of each user
foreach($users as $a_user) {
foreach ($users as $a_user) {
$messulib->post_message($a_user, $user, $a_user, '', $_REQUEST['subject'], $_REQUEST['body'], $_REQUEST['priority']);
// if this is a reply flag the original messages replied to
if ($_REQUEST['replyto_hash'] <> '') {
......
......@@ -35,7 +35,7 @@ if (!empty($_REQUEST['reply']) || !empty($_REQUEST['replyall'])) {
$_REQUEST['subject'] = tra("Re:") . preg_replace('/^(' . tra('Re:') . ')+/', '', $_REQUEST['subject']);
$smarty->assign('reply', 'y');
}
foreach(array(
foreach (array(
'to',
'cc',
'bcc'
......@@ -77,7 +77,7 @@ if (isset($_REQUEST['send'])) {
}
// Remove invalid users from the to, cc and bcc fields
$users = array();
foreach($arr_to as $a_user) {
foreach ($arr_to as $a_user) {
if (!empty($a_user)) {
$a_user = str_replace('\\;', ';', $a_user);
if ($userlib->user_exists($a_user)) {
......@@ -97,7 +97,7 @@ if (isset($_REQUEST['send'])) {
}
}
}
foreach($arr_cc as $a_user) {
foreach ($arr_cc as $a_user) {
if (!empty($a_user)) {
$a_user = str_replace('\\;', ';', $a_user);
if ($userlib->user_exists($a_user)) {
......@@ -117,7 +117,7 @@ if (isset($_REQUEST['send'])) {
}
}
}
foreach($arr_bcc as $a_user) {
foreach ($arr_bcc as $a_user) {
if (!empty($a_user)) {
$a_user = str_replace('\\;', ';', $a_user);
if ($userlib->user_exists($a_user)) {
......@@ -151,7 +151,7 @@ if (isset($_REQUEST['send'])) {
die;
}
// Insert the message in the inboxes of each user
foreach($users as $a_user) {
foreach ($users as $a_user) {
$result = $messulib->post_message($a_user, $user, $_REQUEST['to'], $_REQUEST['cc'], $_REQUEST['subject'], $_REQUEST['body'], $_REQUEST['priority'], $_REQUEST['replyto_hash'],
isset($_REQUEST['replytome']) ? 'y' : '', isset($_REQUEST['bccme']) ? 'y' : '');
if ($result) {
......
......@@ -8,7 +8,7 @@
if (!defined('STDOUT') || !defined('STDIN') || !defined('STDERR'))
die("<p>shell only</p>");
if( isset( $_SERVER['REQUEST_METHOD'] ) ) die;
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) die;
// Initialization
require_once ('tiki-setup.php');
......@@ -162,12 +162,12 @@ function command_list($goption, $coption, $cparams) {
$regex=$cparams[0];
} else $regex='';
foreach($repos as $reponame => $repo) {
foreach ($repos as $reponame => $repo) {
if ($reponame == 'remote' && in_array('-l', $coption)) continue;
if ($reponame != 'installed' && in_array('-i', $coption)) continue;
$content=$modslib->read_list($repo['url'], $reponame);
foreach($content as $meat) {
foreach($meat as $mod) {
foreach ($content as $meat) {
foreach ($meat as $mod) {
if (($regex !== '') && !preg_match('/'.$regex.'/', $mod->modname))
continue;
$merged[$mod->type][$mod->name][$reponame]=$mod;
......@@ -176,13 +176,13 @@ function command_list($goption, $coption, $cparams) {
}
foreach($merged as $k => $meat) {
foreach ($merged as $k => $meat) {
ksort($merged[$k]);
}
ksort($merged);
foreach($merged as $type => $meat) {
foreach ($merged as $type => $meat) {
echo $type.":\n";
foreach($meat as $name => $submeat) {
foreach ($meat as $name => $submeat) {
$rev_installed = isset($submeat['installed']) ? $submeat['installed']->revision : '';
$rev_remote = isset($submeat['remote']) ? $submeat['remote']->revision : '';
printf(" %-24.24s | %7.7s | %7.7s\n", $name, $rev_installed, $rev_remote);
......@@ -194,10 +194,10 @@ function command_show($goption, $coption, $cparams) {
global $repos;
global $modslib;
foreach($cparams as $cparam) {
foreach ($cparams as $cparam) {
$found=NULL;
$mod=new TikiMod($cparam);
foreach($repos as $reponame => $repo) {
foreach ($repos as $reponame => $repo) {
$content=$modslib->read_list($repo['url'], $reponame);
if (isset($content[$mod->type][$mod->name])) {
$found=$content[$mod->type][$mod->name];
......@@ -218,7 +218,7 @@ function command_show($goption, $coption, $cparams) {
if (is_array($mod->author) && count($mod->author)) {
echo "Author:\n";
foreach($mod->author as $author) {
foreach ($mod->author as $author) {
echo $author."\n";
}
echo "\n";
......@@ -226,7 +226,7 @@ function command_show($goption, $coption, $cparams) {
if (is_array($mod->description) && count($mod->description)) {
echo "Description:\n";
foreach($mod->description as $description) {
foreach ($mod->description as $description) {
echo $description."\n";
}
echo "\n";
......@@ -237,7 +237,7 @@ function command_show($goption, $coption, $cparams) {
if (is_array($mod->version) && count($mod->version)) {
echo "Version:\n";
foreach($mod->version as $version) {
foreach ($mod->version as $version) {
echo $version."\n";
}
echo "\n";
......@@ -251,7 +251,7 @@ function command_show($goption, $coption, $cparams) {
if (is_array($mod->configuration) && count($mod->configuration)) {
echo "Configuration:\n";
foreach($mod->configuration as $configuration) {
foreach ($mod->configuration as $configuration) {
echo $configuration."\n";
}
echo "\n";
......@@ -259,7 +259,7 @@ function command_show($goption, $coption, $cparams) {
if (is_array($mod->configuration_help) && count($mod->configuration_help)) {
echo "Configuration Help:\n";
foreach($mod->configuration_help as $configuration_help) {
foreach ($mod->configuration_help as $configuration_help) {
echo $configuration_help."\n";
}
echo "\n";
......@@ -267,7 +267,7 @@ function command_show($goption, $coption, $cparams) {
if (is_array($mod->files) && count($mod->files)) {
echo "Files:\n";
foreach($mod->files as $files) {
foreach ($mod->files as $files) {
echo $files."\n";
}
echo "\n";
......@@ -275,7 +275,7 @@ function command_show($goption, $coption, $cparams) {
if (is_array($mod->contributor) && count($mod->contributor)) {
echo "Contributor:\n";
foreach($mod->contributor as $contributor) {
foreach ($mod->contributor as $contributor) {
echo $contributor."\n";
}
echo "\n";
......@@ -283,7 +283,7 @@ function command_show($goption, $coption, $cparams) {
if (is_array($mod->devurl) && count($mod->devurl)) {
echo "devurl:\n";
foreach($mod->devurl as $devurl) {
foreach ($mod->devurl as $devurl) {
echo $devurl."\n";
}
echo "\n";
......@@ -291,7 +291,7 @@ function command_show($goption, $coption, $cparams) {
if (is_array($mod->docurl) && count($mod->docurl)) {
echo "docurl:\n";
foreach($mod->docurl as $docurl) {
foreach ($mod->docurl as $docurl) {
echo $docurl."\n";
}
echo "\n";
......@@ -299,7 +299,7 @@ function command_show($goption, $coption, $cparams) {
if (is_array($mod->help) && count($mod->help)) {
echo "Help:\n";
foreach($mod->help as $help) {
foreach ($mod->help as $help) {
echo $help."\n";
}
echo "\n";
......@@ -307,7 +307,7 @@ function command_show($goption, $coption, $cparams) {
if (is_array($mod->url) && count($mod->url)) {
echo "url:\n";
foreach($mod->url as $url) {
foreach ($mod->url as $url) {
echo $url."\n";
}
echo "\n";
......@@ -315,7 +315,7 @@ function command_show($goption, $coption, $cparams) {
if (is_array($mod->sql_upgrade) && count($mod->sql_upgrade)) {
echo "sql_Upgrade:\n";
foreach($mod->sql_upgrade as $sql_upgrade) {
foreach ($mod->sql_upgrade as $sql_upgrade) {
echo $sql_upgrade."\n";
}
echo "\n";
......@@ -323,7 +323,7 @@ function command_show($goption, $coption, $cparams) {
if (is_array($mod->sql_install) && count($mod->sql_install)) {
echo "sql_Install:\n";
foreach($mod->sql_install as $sql_install) {
foreach ($mod->sql_install as $sql_install) {
echo $sql_install."\n";
}
echo "\n";
......@@ -331,7 +331,7 @@ function command_show($goption, $coption, $cparams) {
if (is_array($mod->sql_remove) && count($mod->sql_remove)) {
echo "sql_Remove:\n";
foreach($mod->sql_remove as $sql_remove) {
foreach ($mod->sql_remove as $sql_remove) {
echo $sql_remove."\n";
}
echo "\n";
......@@ -352,14 +352,14 @@ function usage($err) {
echo "usage:\n";
echo "php modsadm.php [options] commande\n\n";
echo "commands:\n";
foreach($commands as $command => $sglonk) {
foreach ($commands as $command => $sglonk) {
echo " ".$command.(isset($sglonk['usage']) ? ' '.$sglonk['usage'] : '')."\n";
}
echo "\ncommands options:\n";
foreach($commands as $command => $sglonk) {
foreach ($commands as $command => $sglonk) {
if (isset($sglonk['options'])) {
echo " ".$command.":\n";
foreach($sglonk['options'] as $k => $option) {
foreach ($sglonk['options'] as $k => $option) {
echo " $k: ".$option['help']."\n";
}
}
......@@ -376,7 +376,7 @@ function readargs($argv) {
$goption=array();
$coption=array();
$cparams=array();
foreach($argv as $argc => $arg) {
foreach ($argv as $argc => $arg) {
if ($argc == 0) continue;
if (substr($arg, 0, 1) == '-') {
......
......@@ -63,7 +63,7 @@ function validate($params) {
}
list($isvalid, $dummy, $error) = $userlib->validate_user($login,$pass,'','');
if(!$isvalid) {
if (!$isvalid) {
$msg = tra('Invalid username or password');
if ($prefs['intertiki_errfile']) logit($prefs['intertiki_errfile'],$msg,$login,INTERTIKI_BADUSER,$prefs['known_hosts'][$key]['name']);
$logslib->add_log('intertiki',$msg.' from '.$prefs['known_hosts'][$key]['name'],$login);
......
......@@ -69,7 +69,7 @@ if (isset($_REQUEST["thumb"])) {
}
}
if($imagegallib->get_etag($id, $itype, $scalesize)!==false) {
if ($imagegallib->get_etag($id, $itype, $scalesize)!==false) {
# Client-Side image cache (based on Etag Headers)
# Etag value is based on the md5 hash of the image. It should change everytime the image changes. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19
......@@ -111,7 +111,7 @@ header ("Etag: ".$imagegallib->etag);
// header ("Content-length: ".$imagegallib->filesize);
header ("Content-Disposition: inline; filename=\"" . $imagegallib->filename.'"');
//if($data["path"]) {
//if ($data["path"]) {
// readfile($prefs['gal_use_dir'].$data["path"].$ter);
//} else {
echo $imagegallib->image;
......
......@@ -46,7 +46,7 @@ if (isset($_REQUEST['book'])) {
$_REQUEST['debitAccount'], $_REQUEST['creditAccount'],
$_REQUEST['debitAmount'], $_REQUEST['creditAmount'],
$_REQUEST['debitText'],$_REQUEST['creditText']);
if(is_numeric($result)) {
if (is_numeric($result)) {
if (isset($_REQUEST['statementId'])) {
$accountinglib->updateStatement($bookId, $_REQUEST['statementId'],$result);
}
......
......@@ -68,7 +68,7 @@ if (isset($_REQUEST['action'])) {
$_REQUEST['debitAmount'], $_REQUEST['creditAmount'],
$_REQUEST['debitText'],$_REQUEST['creditText']);
}
if(is_numeric($result)) {
if (is_numeric($result)) {
if (isset($_REQUEST['statementId'])) {
$accountinglib->updateStatementStack($bookId, $_REQUEST['statementId'],$result);
}
......
......@@ -153,22 +153,22 @@ $adminPage = '';
global $prefslib; require_once 'lib/prefslib.php';
if( isset ($_REQUEST['pref_filters']) ) {
if ( isset ($_REQUEST['pref_filters']) ) {
$prefslib->setFilters( $_REQUEST['pref_filters'] );
}
$temp_filters = isset($_REQUEST['filters']) ? explode(' ', $_REQUEST['filters']) : null;
$smarty->assign('pref_filters', $prefslib->getFilters($temp_filters));
if( isset( $_REQUEST['lm_preference'] ) ) {
if ( isset( $_REQUEST['lm_preference'] ) ) {
$changes = $prefslib->applyChanges( (array) $_REQUEST['lm_preference'], $_REQUEST );
foreach( $changes as $pref => $val ) {
foreach ( $changes as $pref => $val ) {
$value = $val['new'];
if( $value == 'y' ) {
if ( $value == 'y' ) {
add_feedback( $pref, tr('%0 enabled', $pref), 1, 1 );
$logslib->add_action('feature', $pref, 'system', 'enabled');
} elseif( $value == 'n' ) {
} elseif ( $value == 'n' ) {
add_feedback( $pref, tr('%0 disabled', $pref), 0, 1 );
$logslib->add_action('feature', $pref, 'system', 'disabled');
} else {
......@@ -178,23 +178,23 @@ if( isset( $_REQUEST['lm_preference'] ) ) {
}
}
if( isset( $_REQUEST['lm_criteria'] ) ) {
if ( isset( $_REQUEST['lm_criteria'] ) ) {
set_time_limit(0);
try {
$smarty->assign( 'lm_criteria', $_REQUEST['lm_criteria'] );
$results = $prefslib->getMatchingPreferences( $_REQUEST['lm_criteria'], $temp_filters );
$results = array_slice( $results, 0, 50 );
$smarty->assign( 'lm_searchresults', $results );
$smarty->assign( 'lm_error', '' );
$smarty->assign('lm_criteria', $_REQUEST['lm_criteria']);
$results = $prefslib->getMatchingPreferences($_REQUEST['lm_criteria'], $temp_filters);
$results = array_slice($results, 0, 50);
$smarty->assign('lm_searchresults', $results);
$smarty->assign('lm_error', '');
} catch(Zend_Search_Lucene_Exception $e) {
$smarty->assign( 'lm_criteria', $_REQUEST['lm_criteria'] );
$smarty->assign( 'lm_error', $e->getMessage() );
$smarty->assign( 'lm_searchresults', '' );
$smarty->assign('lm_criteria', $_REQUEST['lm_criteria']);
$smarty->assign('lm_error', $e->getMessage());
$smarty->assign('lm_searchresults', '');
}
} else {
$smarty->assign( 'lm_criteria', '' );
$smarty->assign( 'lm_searchresults', '' );
$smarty->assign( 'lm_error', '' );
$smarty->assign('lm_criteria', '');
$smarty->assign('lm_searchresults', '');
$smarty->assign('lm_error', '');
}
$smarty->assign('indexNeedsRebuilding', $prefslib->indexNeedsRebuilding());
......
......@@ -77,7 +77,7 @@ if ( !empty($_REQUEST['export']) ) {
if ($tiki_p_admin == 'y') {
if (isset($_REQUEST['save'])) {
foreach($action_log_conf_selected as $index => $conf) {
foreach ($action_log_conf_selected as $index => $conf) {
if (isset($_REQUEST['v_' . $conf['code']]) && $_REQUEST['v_' . $conf['code']] == 'on') { //viewed and reported
$logslib->set_actionlog_conf($conf['action'], $conf['objectType'], 'v');
} elseif (isset($_REQUEST[$conf['code']]) && $_REQUEST[$conf['code']] == 'on') {
......@@ -94,7 +94,7 @@ if ($tiki_p_admin == 'y') {
} else {
if (isset($_REQUEST['save'])) {
$_prefs = 'v';
foreach($action_log_conf_selected as $index => $conf) {
foreach ($action_log_conf_selected as $index => $conf) {
if ($conf['status'] == 'v' || $conf['status'] == 'y') { // can only change what is recorded
if (isset($_REQUEST['v_' . $conf['code']]) && $_REQUEST['v_' . $conf['code']] == 'on') { //viewed
$_prefs.= $conf['id'] . 'v';
......@@ -111,7 +111,7 @@ if ($tiki_p_admin == 'y') {
} else {
$_prefs = $tikilib->get_user_preference($user, 'actionlog_conf', '');
if (!empty($_prefs)) {
foreach($confs as $i => $conf) {
foreach ($confs as $i => $conf) {
if ($confs[$i]['status'] == 'v' || $confs[$i]['status'] == 'y') {
if (preg_match('/[vy]' . $confs[$i]['id'] . '([vy])/', $_prefs, $matches)) $confs[$i]['status'] = $matches[1];
}
......@@ -121,7 +121,7 @@ if ($tiki_p_admin == 'y') {
global $actionlogConf;
$actionlogConf = $confs;
}
foreach($confs as $conf) {
foreach ($confs as $conf) {
if ($conf['status'] == 'v') {
++$nbViewedConfs;
}
......@@ -167,7 +167,7 @@ if (!empty($_REQUEST['actionId']) && $tiki_p_admin == 'y') {
if (count($_REQUEST['cat_categories']) > 1) {
$action['params'] = $logslib->get_action_params($_REQUEST['actionId']);
$action['contributions'] = $logslib->get_action_contributions($_REQUEST['actionId']);
foreach($_REQUEST['cat_categories'] as $cat) {
foreach ($_REQUEST['cat_categories'] as $cat) {
if ($cat != $old_categ) {
$logslib->add_action($action['action'], $action['object'], $action['objectType'], $action['comment'], $action['user'], $action['ip'], '', $action['lastModif'], '', '');
}
......@@ -184,7 +184,7 @@ if (!empty($_REQUEST['actionId']) && $tiki_p_admin == 'y') {
$info = $tikilib->get_page_info($action['object']);
$contributors = $logslib->get_wiki_contributors($info);
$tcontributors = array();
foreach($contributors as $c) {
foreach ($contributors as $c) {
$tcontributors[] = $c['userId'];
}
$smarty->assign_by_ref('contributors', $tcontributors);
......@@ -195,7 +195,7 @@ if (!empty($_REQUEST['actionId']) && $tiki_p_admin == 'y') {
}
$cont = array();
foreach($contributions as $contribution) {
foreach ($contributions as $contribution) {
$cont[] = $contribution['contributionId'];
}
$_REQUEST['contributions'] = $cont;
......@@ -207,7 +207,7 @@ if (!empty($_REQUEST['actionId']) && $tiki_p_admin == 'y') {
if (!empty($_REQUEST['startDate'])) $smarty->assign('startDate', $_REQUEST['startDate']);
if (!empty($_REQUEST['endDate'])) $smarty->assign('endDate', $_REQUEST['endDate']);
if (!empty($action['categId'])) {
foreach($categories as $i => $cat) {
foreach ($categories as $i => $cat) {
if ($action['categId'] == $cat['categId']) {
$categories[$i]['incat'] = 'y';
}
......@@ -231,13 +231,13 @@ if ($tiki_p_admin == 'y') {
);
}
$selectedGroups = array();
foreach($groups as $g) {
foreach ($groups as $g) {
$selectedGroups[$g] = 'y';
}
$smarty->assign_by_ref('users', $users);
$smarty->assign_by_ref('groups', $groups);
$smarty->assign_by_ref('categories', $categories);
foreach($categories as $categ) {
foreach ($categories as $categ) {
$categNames[$categ['categId']] = $categ['name'];
}
$smarty->assign_by_ref('categNames', $categNames);
......@@ -246,7 +246,7 @@ if (isset($_REQUEST['list']) || isset($_REQUEST['export']) || isset($_REQUEST['g
$url = '';
$selectedUsers = array();
if (isset($_REQUEST['selectedUsers'])) {
foreach($users as $key => $u) {
foreach ($users as $key => $u) {
if (in_array($u, $_REQUEST['selectedUsers'])) {
$url.= "&amp;selectedUsers[]=$u";
$selectedUsers[$key] = 'y';
......@@ -256,13 +256,13 @@ if (isset($_REQUEST['list']) || isset($_REQUEST['export']) || isset($_REQUEST['g
$smarty->assign('selectedUsers', $selectedUsers);
if (isset($_REQUEST['selectedGroups']) && !(count($_REQUEST['selectedGroups']) == 1 && $_REQUEST['selectedGroups'][0] == '')) {
$selectedGroups = array();
foreach($groups as $key => $g) {
foreach ($groups as $key => $g) {
if (in_array($g, $_REQUEST['selectedGroups'])) {
$url.= "&amp;selectedGroups[]=$g";
$selectedGroups[$g] = 'y';
if ($tiki_p_admin == 'y' || $tiki_p_view_actionlog_owngroups == 'y') {
$members = $userlib->get_group_users($g);
foreach($members as $m) {
foreach ($members as $m) {
$_REQUEST['selectedUsers'][] = $m;
$selectedUsers[$m] = 'y';
}
......@@ -348,7 +348,7 @@ if (isset($_REQUEST['list']) || isset($_REQUEST['export']) || isset($_REQUEST['g
if (isset($_REQUEST['sort_mode'])) {
list($col, $order) = explode('_', $_REQUEST['sort_mode']);
$sort = array();
foreach($actions as $a) {
foreach ($actions as $a) {
$sort[] = isset($a[$col]) ? $a[$col] : '';
}
array_multisort($sort, ($order == 'desc') ? SORT_DESC : SORT_ASC, $actions);
......@@ -380,22 +380,22 @@ if (isset($_REQUEST['list']) || isset($_REQUEST['export']) || isset($_REQUEST['g
if (isset($_REQUEST['graph'])) {
$contributions = $contributionlib->list_contributions(0, -1);
$legendWidth = 0;
foreach($contributions['data'] as $contribution) {
foreach ($contributions['data'] as $contribution) {
$legendWidth = max($legendWidth, strlen($contribution['name']));
}
$legendWidth = $legendWidth * 7 + 20;
$xUserTickWidth = 0;
foreach($userContributions['data'] as $u => $val) {
foreach ($userContributions['data'] as $u => $val) {
$xUserTickWidth = max($xUserTickWidth, strlen($u));
}
$xUserTickWidth = $xUserTickWidth * 7;
$xGroupTickWidth = 0;
foreach($groupContributions as $g => $val) {
foreach ($groupContributions as $g => $val) {
$xGroupTickWidth = max($xGroupTickWidth, strlen($g));
}