Commit 8f79537d authored by changi67's avatar changi67

no changes - code quality

parent e778f9c3
......@@ -68,10 +68,10 @@ if (isset($_REQUEST['comzone'])) {
$comzone_state = $_REQUEST['comzone'];
if ($comzone_state=='show'||$comzone_state=='o') {
$comments_show = 'y';
if (!isset($_COOKIE['comzone'])||$_COOKIE['comzone']=='c') setcookie('comzone','o');
if (!isset($_COOKIE['comzone'])||$_COOKIE['comzone']=='c') setcookie('comzone', 'o');
}
if ($comzone_state=='hide'||$comzone_state=='c') {
if (!isset($_COOKIE['comzone'])||$_COOKIE['comzone']=='o') setcookie('comzone','c');
if (!isset($_COOKIE['comzone'])||$_COOKIE['comzone']=='o') setcookie('comzone', 'c');
}
} else {
$comments_show = 'n';
......@@ -231,14 +231,14 @@ if ($_REQUEST["comments_threadId"] > 0) {
if ( ($prefs['feature_forum_parse'] == 'y' || $prefs['section_comments_parse'] == 'y') && $prefs['feature_use_quoteplugin'] == 'y' ) {
$comment_info["data"] = "\n{QUOTE(replyto=>" . $comment_info["userName"] . ")}" . $comment_info["data"] . '{QUOTE}';
} else {
$comment_info["data"] = preg_replace( '/\n/', "\n> ", $comment_info["data"] ) ;
$comment_info["data"] = preg_replace('/\n/', "\n> ", $comment_info["data"]);
$comment_info["data"] = "\n> " . $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"] = "";
......@@ -337,10 +337,12 @@ if (empty($thread_sort_mode)) {
}
}
$comments_coms = $commentslib->get_comments($comments_objectId,
$_REQUEST["comments_parentId"],
$comments_offset, $comments_per_page, $thread_sort_mode, $_REQUEST["comments_commentFind"],
$_REQUEST['comments_threshold'], $thread_style, $threadId_if_reply);
$comments_coms = $commentslib->get_comments(
$comments_objectId,
$_REQUEST["comments_parentId"],
$comments_offset, $comments_per_page, $thread_sort_mode, $_REQUEST["comments_commentFind"],
$_REQUEST['comments_threshold'], $thread_style, $threadId_if_reply
);
if ($comments_prefix_var == 'forum:') {
$comments_cant = $commentslib->count_comments('topic:'. $_REQUEST['comments_parentId']); // comments in the topic not in the forum
......@@ -360,7 +362,7 @@ if ( $comments_maxRecords != 0 ) {
$smarty->assign('comments_actual_page', 1 + ($comments_offset / $comments_maxRecords));
} else {
$comments_cant_pages = 1;
$smarty->assign('comments_actual_page', 1 );
$smarty->assign('comments_actual_page', 1);
}
$smarty->assign('comments_cant_pages', $comments_cant_pages);
......@@ -377,7 +379,7 @@ if ($comments_offset > 0) {
$smarty->assign('comments_prev_offset', -1);
}
$smarty->assign('comments_coms', $comments_coms["data"] );
$smarty->assign('comments_coms', $comments_coms["data"]);
// Grab the parent comment to show. -rlpowell
if (isset($_REQUEST["comments_parentId"])
......
......@@ -129,27 +129,27 @@ class FileGallery_File
if ($this->exists() == false) {
$id = TikiLib::lib("filegal")->insert_file(
($this->getParam('galleryId') || 1), //zero makes it not show by default
$this->getParam('filename'),
$this->getParam('description'),
$this->getParam('filename'),
$data,
strlen($data),
$this->getParam('filetype'),
$user
($this->getParam('galleryId') || 1), //zero makes it not show by default
$this->getParam('filename'),
$this->getParam('description'),
$this->getParam('filename'),
$data,
strlen($data),
$this->getParam('filetype'),
$user
);
} else {
$id = TikiLib::lib("filegal")->save_archive(
$this->getParam('fileId'),
$this->getParam('galleryId'),
0,
$this->getParam('filename'),
$this->getParam('description'),
$this->getParam('filename'),
$data,
strlen($data),
$this->getParam('filetype'),
$user
$this->getParam('fileId'),
$this->getParam('galleryId'),
0,
$this->getParam('filename'),
$this->getParam('description'),
$this->getParam('filename'),
$data,
strlen($data),
$this->getParam('filetype'),
$user
);
}
......
......@@ -24,7 +24,8 @@ class Services_Connect_Client
}
function action_vote($input) {
function action_vote($input)
{
global $prefs;
if (! Perms::get()->admin) {
......@@ -38,16 +39,16 @@ class Services_Connect_Client
$vote = $input->vote->text();
$pref = $input->pref->text();
$votes = $this->connectlib->getVotes( true );
$votes = $this->connectlib->getVotes(true);
if (!isset( $votes[$pref] )) {
$votes[$pref] = array();
}
$arr = $votes[$pref];
if (substr($vote, 0, 2) === 'un') {
$vote = substr( $vote, 2 );
unset($arr[ array_search( $vote, $arr )]);
} else if (!in_array( $vote, $arr )){
$vote = substr($vote, 2);
unset($arr[ array_search($vote, $arr)]);
} else if (!in_array($vote, $arr)) {
$arr[] = $vote;
$vote = 'un' . $vote; // send back the opposite vote to update the icon
}
......@@ -59,7 +60,8 @@ class Services_Connect_Client
return array( 'newVote' => $vote );
}
function action_list($input = null) {
function action_list($input = null)
{
if (! Perms::get()->admin) {
throw new Services_Exception(tr('Reserved to administrators during development'), 403);
}
......@@ -69,7 +71,8 @@ class Services_Connect_Client
return $info;
}
function action_send($input) {
function action_send($input)
{
global $prefs;
if (! Perms::get()->admin) {
......@@ -96,11 +99,14 @@ class Services_Connect_Client
}
} else {
$data = $this->remote->confirm( array(
'connect_data' => array(
'guid' => $pending,
'captcha' => $input->captcha->filter(),
)));
$data = $this->remote->confirm(
array(
'connect_data' => array(
'guid' => $pending,
'captcha' => $input->captcha->filter(),
)
)
);
$this->connectlib->removeGuid($pending);
......@@ -122,7 +128,7 @@ class Services_Connect_Client
$odata['guid'] = $prefs['connect_guid'];
$data = $this->remote->receive( array( 'connect_data' => $odata ));
$data = $this->remote->receive(array( 'connect_data' => $odata ));
if ($data && $data['status'] === 'received') {
$status = 'sent';
......@@ -135,13 +141,12 @@ class Services_Connect_Client
return $data;
}
function action_cancel($input) {
function action_cancel($input)
{
$guid = $input->guid->filter();
if ($guid) {
$this->connectlib->removeGuid($guid);
$r = $this->remote->cancel(array(
'connect_data' => array('guid' => $guid)
));
$r = $this->remote->cancel(array('connect_data' => array('guid' => $guid)));
}
return array('guid' => $guid);
}
......
......@@ -12,101 +12,110 @@ class Encoding
var $_ouputSupportedEncodings = array ('ISO-8859-1','ISO-8859-15','UTF-8',);
var $_supportedEncodings = 'UTF-8,ISO-8859-1,ISO-8859-15';
// Class constructor
function Encoding ($inputEncoding = 'ISO-8859-1',$outputEncoding = 'UTF-8') {
// Class constructor
function Encoding ($inputEncoding = 'ISO-8859-1',$outputEncoding = 'UTF-8')
{
// Check if mb_convert_encoding is installed
if (function_exists('mb_convert_encoding') && $this->set_input_encoding ($inputEncoding) && $this->set_output_encoding($outputEncoding)) {
return true;
}
else {
return false;
}
}
// Check if mb_convert_encoding is installed
if (function_exists('mb_convert_encoding') && $this->set_input_encoding($inputEncoding) && $this->set_output_encoding($outputEncoding)) {
return true;
} else {
return false;
}
}
// Set default input encoding, return false if fails loading encoding
function set_input_encoding ($encoding) {
// Set default input encoding, return false if fails loading encoding
function set_input_encoding ($encoding)
{
$this->_input_encoding = $encoding;
return true;
}
}
// Set default output encoding, return false if fails loading encoding
function set_output_encoding ($encoding) {
// Set default output encoding, return false if fails loading encoding
function set_output_encoding ($encoding)
{
$this->_output_encoding = $encoding;
return true;
}
}
// Get default input encoding
function get_input_encoding () {
// Get default input encoding
function get_input_encoding ()
{
return $this->_input_encoding;
}
}
// Get default output encoding
function get_output_encoding () {
return $this->_output_encoding;
}
// Get default output encoding
function get_output_encoding ()
{
return $this->_output_encoding;
}
// Return encoding of a string
function detect_encoding ($str) {
return mb_detect_encoding ($str,$this->_supportedEncodings);
}
// Convert string to another encoding, return false on failure
function convert_encoding ($str, $inputEncoding = NULL, $outputEncoding = NULL) {
if ($inputEncoding == NULL || $inputEncoding == '') {
if ($this->get_input_encoding () == '') {
$this->set_input_encoding ($this->detect_encoding($str));
}
$inputEncoding = $this->get_input_encoding();
}
if ($outputEncoding == NULL || $inputEncoding == '') {
if ($this->get_output_encoding () == '') {
$this->set_output_encoding ($this->detect_encoding($str));
}
$outputEncoding = $this->get_output_encoding();
}
// $returnStr = mb_convert_encoding ($str, $outputEncoding, $inputEncoding);
$returnStr = iconv($inputEncoding, $outputEncoding."//TRANSLIT", $str);
// print $outputEncoding.' - '.$inputEncoding.' - '.$returnStr.'<br>';
return $returnStr;
}
// Returns true if $string is valid UTF-8 and false otherwise.
function is_utf8($str) {
// From http://w3.org/International/questions/qa-forms-utf-8.html
return preg_match('%^(?:
[\x09\x0A\x0D\x20-\x7E] # ASCII
| [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
| \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
| [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
| \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
| \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
)*$%xs', $str);
}
// Return array of supported input encodings
function get_input_supported_encodings () {
return $this->_inputSupportedEncodings;
}
// Return array of supported output encodings
function get_output_supported_encodings () {
return $this->_outputSupportedEncodings;
}
// Return array of supported encodings
function get_supported_encodings () {
return $this->_supportedEncodings;
}
// Return encoding of a string
function detect_encoding ($str)
{
return mb_detect_encoding($str, $this->_supportedEncodings);
}
// Convert string to another encoding, return false on failure
function convert_encoding ($str, $inputEncoding = NULL, $outputEncoding = NULL)
{
if ($inputEncoding == NULL || $inputEncoding == '') {
if ($this->get_input_encoding() == '') {
$this->set_input_encoding($this->detect_encoding($str));
}
$inputEncoding = $this->get_input_encoding();
}
if ($outputEncoding == NULL || $inputEncoding == '') {
if ($this->get_output_encoding() == '') {
$this->set_output_encoding($this->detect_encoding($str));
}
$outputEncoding = $this->get_output_encoding();
}
// $returnStr = mb_convert_encoding ($str, $outputEncoding, $inputEncoding);
$returnStr = iconv($inputEncoding, $outputEncoding."//TRANSLIT", $str);
// print $outputEncoding.' - '.$inputEncoding.' - '.$returnStr.'<br>';
return $returnStr;
}
// Returns true if $string is valid UTF-8 and false otherwise.
function is_utf8($str)
{
// From http://w3.org/International/questions/qa-forms-utf-8.html
return preg_match('%^(?:
[\x09\x0A\x0D\x20-\x7E] # ASCII
| [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
| \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
| [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
| \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
| \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
)*$%xs', $str);
}
// Return array of supported input encodings
function get_input_supported_encodings ()
{
return $this->_inputSupportedEncodings;
}
// Return array of supported output encodings
function get_output_supported_encodings ()
{
return $this->_outputSupportedEncodings;
}
// Return array of supported encodings
function get_supported_encodings ()
{
return $this->_supportedEncodings;
}
}
......@@ -17,48 +17,52 @@ if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__)) !== false) {
class groupAlertLib extends TikiLib
{
function AddGroup ($ObjectType, $ObjectNumber,$GroupName,$displayEachUser) {
function AddGroup ($ObjectType, $ObjectNumber,$GroupName,$displayEachUser)
{
if ( $displayEachUser == "on" ) $displayEachUser='y';
if ( $displayEachUser == "" ) $displayEachUser='n';
$query ="delete from `tiki_groupalert` where ( `objectType`= ? and `objectId` = ?) ";
$this->query($query,array($ObjectType,$ObjectNumber));
$this->query($query, array($ObjectType,$ObjectNumber));
if ( $GroupName != '' ) {
$query = "insert into `tiki_groupalert` ( `groupName`,`objectType`,`objectId`,`displayEachuser` ) values (?,?,?,?)";
$this->query($query,array($GroupName,$ObjectType,$ObjectNumber,$displayEachUser));
$this->query($query, array($GroupName,$ObjectType,$ObjectNumber,$displayEachUser));
}
return true;
}
function GetGroup ($ObjectType,$ObjectNumber) {
$res= $this->getOne( "select `groupName` from `tiki_groupalert` where ( `objectType` = ? and `objectId` = ? )", array($ObjectType,$ObjectNumber));
function GetGroup ($ObjectType,$ObjectNumber)
{
$res= $this->getOne("select `groupName` from `tiki_groupalert` where ( `objectType` = ? and `objectId` = ? )", array($ObjectType,$ObjectNumber));
return $res ;
}
function GetShowEachUser($ObjectType,$ObjectNumber,$GroupName ) {
return $this->getOne( "select `displayEachuser` from `tiki_groupalert` where ( `objectType` = ? and `objectId` = ? and `groupName` =? )", array($ObjectType,$ObjectNumber,$GroupName));
function GetShowEachUser($ObjectType,$ObjectNumber,$GroupName )
{
return $this->getOne("select `displayEachuser` from `tiki_groupalert` where ( `objectType` = ? and `objectId` = ? and `groupName` =? )", array($ObjectType,$ObjectNumber,$GroupName));
}
function Notify ( $ListUserToAlert,$URI ) {
function Notify ( $ListUserToAlert,$URI )
{
global $tikilib,$userlib ;
if (!is_array($ListUserToAlert)) {
return;
}
$project=$tikilib->get_preference ("browsertitle");
$project=$tikilib->get_preference("browsertitle");
$foo = parse_url($_SERVER["REQUEST_URI"]);
$machine = $tikilib->httpPrefix( true ) . dirname( $foo["path"] );
$machine = $tikilib->httpPrefix(true) . dirname($foo["path"]);
$URL=$machine."/".$URI;
foreach ( $ListUserToAlert as $user ){
$email=$userlib->get_user_email($user);
if ( ! empty($email) ){
include_once ('lib/webmail/tikimaillib.php');
$mail = new TikiMail();
$mail->setText(tra("You are alerted by the server "). $project . "\n" . tra ("You can check the modifications at : ") .$URL );
$mail->setSubject(tra("You are alerted of a change on ").$project );
$mail->send(array($email));
foreach ( $ListUserToAlert as $user ) {
$email=$userlib->get_user_email($user);
if ( ! empty($email) ) {
include_once ('lib/webmail/tikimaillib.php');
$mail = new TikiMail();
$mail->setText(tra("You are alerted by the server "). $project . "\n" . tra("You can check the modifications at : ") .$URL);
$mail->setSubject(tra("You are alerted of a change on ").$project);
$mail->send(array($email));
}
}
}
}
}
global $groupalertlib;
$groupalertlib = new groupAlertLib;
......@@ -73,12 +73,13 @@ class MenuLib extends TikiLib
return true;
}
function clone_menu($menuId) {
function clone_menu($menuId)
{
$menus = $this->table('tiki_menus');
$row = $menus->fetchFullRow(array( 'menuId' => $menuId ));
$row['menuId'] = null;
$row['name'] = $row['name'] . ' ' . tra('(copy)');
$newId = $menus->insert( $row );
$newId = $menus->insert($row);
$menuoptions = $this->table('tiki_menu_options');
$oldoptions = $menuoptions->fetchAll($menuoptions->all(), array( 'menuId' => $menuId ));
......@@ -87,14 +88,15 @@ class MenuLib extends TikiLib
foreach ( $oldoptions as $row ) {
$row['optionId'] = null;
$row['menuId'] = $newId;
$menuoptions->insert( $row );
$menuoptions->insert($row);
}
}
/*
* Replace the current menu options for id 42 with what's in tiki.sql
*/
function reset_app_menu() {
function reset_app_menu()
{
$tiki_sql = file_get_contents('db/tiki.sql');
preg_match_all('/^INSERT (?:INTO )?`tiki_menu_options` .*$/mi', $tiki_sql, $matches);
......@@ -215,7 +217,7 @@ class MenuLib extends TikiLib
if (isset($channels['data'])) {
$cant = $channels['cant'];
$channels = $channels['data'];
}
}
$types = array("o" => "option",
"s" => "section level 0",
......@@ -227,7 +229,7 @@ class MenuLib extends TikiLib
foreach ($channels as &$channel) {
$channel["type_description"] = tra($types[$channel["type"]]);
}
}
if (isset($cant)) {
$channels = array ('data' => $channels,
......@@ -251,7 +253,7 @@ class MenuLib extends TikiLib
$menu_cache_removed = array();
while ( $res = $result->fetchRow() ) {
$p = parse_url($res['url']);
if ( $p['path'] == 'tiki-index.php' ) {
if ( $p['path'] == 'tiki-index.php' ) {
$this->parse_str($p['query'], $p);
if ( $p['page'] == $oldName ) {
$url = str_replace($oldName, $newName, $res['url']);
......@@ -265,7 +267,7 @@ class MenuLib extends TikiLib
}
}
// look if the current url matches the menu option - to be improved a lot
// look if the current url matches the menu option - to be improved a lot
function menuOptionMatchesUrl($option)
{
global $prefs;
......@@ -544,12 +546,14 @@ class MenuLib extends TikiLib
echo $data;
die;
}
function get_option($menuId, $url) {
function get_option($menuId, $url)
{
$query = 'select `optionId` from `tiki_menu_options` where `menuId`=? and `url`=?';
return $this->getOne($query, array($menuId, $url));
}
function get_menu($menuId) {
function get_menu($menuId)
{
$res = $this->table('tiki_menus')->fetchFullRow(array('menuId' => (int) $menuId));
if ( empty($res['icon']) ) {
......@@ -560,7 +564,8 @@ class MenuLib extends TikiLib
return $res;
}
function list_menu_options($menuId, $offset=0, $maxRecords=-1, $sort_mode='position_asc', $find='', $full=false, $level=0) {
function list_menu_options($menuId, $offset=0, $maxRecords=-1, $sort_mode='position_asc', $find='', $full=false, $level=0)
{
global $user, $tiki_p_admin, $prefs;
$wikilib = TikiLib::lib('wiki');
......@@ -598,7 +603,7 @@ class MenuLib extends TikiLib
if (isset($res['section']) and $res['section']) {
if (strstr($res['section'], '|')) {
$display = false;
$sections = preg_split('/\s*\|\s*/',$res['section']);
$sections = preg_split('/\s*\|\s*/', $res['section']);
foreach ($sections as $sec) {
if (!isset($prefs[$sec]) or $prefs[$sec] != 'y') {
$display = true;
......@@ -607,7 +612,7 @@ class MenuLib extends TikiLib
}
} else {
$display = true;
$sections = preg_split('/\s*,\s*/',$res['section']);
$sections = preg_split('/\s*,\s*/', $res['section']);
foreach ($sections as $sec) {
if (!isset($prefs[$sec]) or $prefs[$sec] != 'y') {
$display = false;
......@@ -620,7 +625,7 @@ class MenuLib extends TikiLib
if (isset($res['perm']) and $res['perm']) {
if (strstr($res['perm'], '|')) {
$display = false;
$sections = preg_split('/\s*\|\s*/',$res['perm']);
$sections = preg_split('/\s*\|\s*/', $res['perm']);
foreach ($sections as $sec) {
if (isset($GLOBALS[$sec]) && $GLOBALS[$sec] == 'y') {
$display = true;
......@@ -628,7 +633,7 @@ class MenuLib extends TikiLib
}
}
} else {
$sections = preg_split('/\s*,\s*/',$res['perm']);
$sections = preg_split('/\s*,\s*/', $res['perm']);
$display = true;
foreach ($sections as $sec) {
if (!isset($GLOBALS[$sec]) or $GLOBALS[$sec] != 'y') {
......@@ -640,13 +645,13 @@ class MenuLib extends TikiLib
}
$usergroups = $this->get_user_groups($user);
if (isset($res['groupname']) and $res['groupname']) {
if ( is_array($res['groupname']) ){
if ( is_array($res['groupname']) ) {
$sections = $res['groupname'];
} else {
$sections = array($res['groupname']);
}
foreach ($sections as $sec) {
if ($sec and !in_array($sec,$usergroups)) {
if ($sec and !in_array($sec, $usergroups)) {
$display = false;
}
}
......@@ -670,7 +675,8 @@ class MenuLib extends TikiLib
/*
*gets result from list_menu_options and sorts "sorted section" sections.
*/
function sort_menu_options($channels) {
function sort_menu_options($channels)
{
$sorted_channels = array();
......
......@@ -21,7 +21,7 @@ if ( !isset($_REQUEST['page']) ) {
$pages = array();
$requested = $tikilib->get_page_info( $_REQUEST['page'] );
$requested = $tikilib->get_page_info($_REQUEST['page']);
$page_id = $requested['page_id'];
$pages[] = $requested;
$unordered = array();
......@@ -35,11 +35,11 @@ if (empty($requested)) {
$likepages = $wikilib->get_like_pages($page);
// if we have exactly one match, redirect to it
if ($prefs['feature_wiki_1like_redirection'] == 'y' && count($likepages) == 1 && !$isUserPage) {
$access->redirect( 'tiki-all_languages.php?page='.urlencode($likepages[0]) );
$access->redirect('tiki-all_languages.php?page='.urlencode($likepages[0]));
}
$smarty->assign_by_ref('likepages', $likepages);
$smarty->assign('create', $isUserPage? 'n': 'y');
$access->display_error( $page, tra('Page cannot be found'), '404' );
$access->display_error($page, tra('Page cannot be found'), '404');
}
$preferred_langs = $multilinguallib->preferredLangs();
......@@ -57,14 +57,14 @@ if (count($preferred_langs) == 1) {
}
// Sort languages according to user's prefences
foreach ( $multilinguallib->getTrads( 'wiki page', $page_id ) as $row )
foreach ( $multilinguallib->getTrads('wiki page', $page_id) as $row)
if ( $row['objId'] != $page_id && in_array($row['lang'], $preferred_langs) )
$unordered[ $row['lang'] ] = $tikilib->get_page_info_from_id( $row['objId'] );
$unordered[ $row['lang'] ] = $tikilib->get_page_info_from_id($row['objId']);
elseif ( $row['lang'] != $requested['lang'] )
$excluded[] = $row['lang'];
foreach ( $preferred_langs as $lang )
if ( array_key_exists( $lang, $unordered ) )
if ( array_key_exists($lang, $unordered) )
$pages[] = $unordered[$lang];
$contents = array();
......@@ -80,12 +80,11 @@ if (count($pages) >= 2) {
}
foreach ( array_reverse( $pages ) as $id => $info )
{
foreach ( array_reverse($pages) as $id => $info ) {
$page = $info['pageName'];
$section = 'wiki page';
$renderer = new WikiRenderer( $info, $user );
$renderer = new WikiRenderer($info, $user);
$renderer->applyPermissions();
if ( $tiki_p_view == 'y' ) {
......@@ -98,7 +97,7 @@ foreach ( array_reverse( $pages ) as $id => $info )
}
}
$contents = array_reverse( $contents );
$contents = array_reverse($contents);
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
$smarty->assign('side_by_side', $show_langs_side_by_side);
......
......@@ -11,14 +11,15 @@ include_once('lib/wiki/wikilib.php');
include_once 'lib/wiki/semanticlib.php';
include_once ('lib/multilingual/multilinguallib.php');
$access->check_feature( array( 'feature_wiki', 'feature_multilingual' ) );
$access->check_permission( 'tiki_p_edit' );
$access->check_feature(array( 'feature_wiki', 'feature_multilingual' ));
$access->check_permission('tiki_p_edit');
compute_relevant_languages();
create_pages_if_necessary();
display();
function create_pages_if_necessary() {
function create_pages_if_necessary()
{
global $smarty, $_REQUEST;
$template_name = null;
if (isset($_REQUEST['template_name'])) {
......@@ -40,7 +41,8 @@ function create_pages_if_necessary() {
make_pages_translations_of_each_other($inexistant_page);
}
function create_page($page_name, $lang, $template_name=null) {
function create_page($page_name, $lang, $template_name=null)
{
global $tikilib, $multilinguallib, $user;