Commit 061176c4 authored by Jonny Bradley's avatar Jonny Bradley

[MRG] Automatic merge, trunk 21290 to 21319

parent 1cd1a95c
......@@ -60,14 +60,14 @@ if ($prefs['feature_categories'] == 'y' && $catobjperms->modify_object_categorie
$can = $catobjperms->modify_object_categories;
for ($iCat = 0; $iCat < $num_categories; $iCat++) {
$catperms = Perms::get( array( 'type' => 'category', 'object' => $categories[$i]['categId'] ) );
$catperms = Perms::get( array( 'type' => 'category', 'object' => $categories[$iCat]['categId'] ) );
if (in_array($categories[$iCat]["categId"], $cats)) {
$categories[$iCat]["incat"] = 'y';
$categories[$i]['canchange'] = ($can && $catperms->remove_object) || isset($cat_object_exists) && ! $cat_object_exists;
$categories[$iCat]['canchange'] = ($can && $catperms->remove_object) || isset($cat_object_exists) && ! $cat_object_exists;
} else {
$categories[$iCat]["incat"] = 'n';
$categories[$i]['canchange'] = $can && $catperms->add_object;
$categories[$iCat]['canchange'] = $can && $catperms->add_object;
}
}
$smarty->assign_by_ref('categories', $categories["data"]);
......
......@@ -414,6 +414,7 @@ class ModLib extends TikiLib {
'cachekeygen' => array( $this, 'createDefaultCacheKey' ),
'prefs' => array(),
'params' => array(),
'common_params' => array()
);
$info = array_merge( $defaults, $info );
......@@ -432,10 +433,6 @@ class ModLib extends TikiLib {
'name' => tra('Decorations'),
'description' => tra('?'),
),
'nonums' => array(
'name' => tra('No numbers'),
'description' => tra('If set to "y", the module will not number list items.'),
),
'perspective' => array(
'name' => tra('Perspective'),
'description' => tra('Only display the module if in one of the listed perspectives. Semi-colon separated.'),
......@@ -484,6 +481,27 @@ class ModLib extends TikiLib {
),
) );
// Parameters common to several modules, but not all
$common_params = array(
'nonums' => array(
'name' => tra('No numbers'),
'description' => tra('If set to "y", the module will not number list items.'),
),
'rows' => array(
'name' => tra('Rows'),
'description' => tra('Number of rows, or items, to display.') . ' ' . tra('Default: 10.'),
)
);
if ($info['type'] == 'function')
foreach($info['common_params'] as $common_param)
$info['params'][$common_param] = $common_params[$common_param];
// Parameters are not required, unless specified.
foreach ($info["params"] as &$param)
if (!isset($param["required"]))
$param["required"] = false;
return $info;
}
......
......@@ -5723,6 +5723,9 @@ class TikiLib extends TikiDb_Bridge {
// Apply filters on values individually
if (!empty($args)) {
foreach( $args as $argKey => &$argValue ) {
if (!isset($params[$argKey])) {
continue;// extra params
}
$paramInfo = $params[$argKey];
$filter = isset($paramInfo['filter']) ? TikiFilter::get($paramInfo['filter']) : $default;
$argValue = $this->htmldecode($argValue);
......
......@@ -1020,13 +1020,13 @@ class TrackerLib extends TikiLib {
$this->tracker_infocache['users_group'][$field['options_array'][0]] = $userlib->get_users_created_group($field['options_array'][0]);
}
if (isset($this->tracker_infocache['users_group'][$field['options_array'][0]][$itemUser])) {
if ($field['options_array'][1] == 'date') {
if (isset($field['options_array'][1]) && $field['options_array'][1] == 'date') {
$value = $this->tracker_infocache['users_group'][$field['options_array'][0]][$itemUser];
} else {
$value = 'Yes';
}
} else {
if ($field['options_array'][1] == 'date') {
if (isset($field['options_array'][1]) && $field['options_array'][1] == 'date') {
$value = '';
} else {
$value = 'No';
......
......@@ -2264,7 +2264,7 @@ function get_included_groups($group, $recur=true) {
}
}
function change_user_email($user, $email, $pass) {
function change_user_email($user, $email, $pass=null) {
// Need to change the email-address for notifications, too
global $notificationlib; include_once('lib/notifications/notificationlib.php');
$oldMail = $this->get_user_email($user);
......
......@@ -7,8 +7,9 @@
// headclass -- css class to apply on head row
//
// Usage:
// The data (and the head paramter) is given one row per line, with columns
// separated by ~|~.
// - The data (and the head paramter) is given one row per line, with columns
// separated by | or ~|~.
// - In any cell, indicate number of columns to span with forward slashes at the beginning, number of rows to span with backslashes.
//
// Example:
// {FANCYTABLE( head=" header column 1 ~|~ header column 2 ~|~ header column 3", headclass=xx )}
......@@ -25,7 +26,7 @@ function wikiplugin_fancytable_info() {
'documentation' => 'PluginFancyTable',
'description' => tra("Displays the data using the Tikiwiki odd/even table style"),
'prefs' => array('wikiplugin_fancytable'),
'body' => tra('One row per line, cells separated by ~|~.'),
'body' => tra('One row per line, cells separated by | or ~|~.'),
'params' => array(
'head' => array(
'required' => false,
......@@ -45,29 +46,45 @@ function wikiplugin_fancytable($data, $params) {
global $tikilib;
// Start the table
$wret = "<table class=\"normal\">";
$wret = '<table class="normal">';
$tdend = "</td>";
$trbeg = "<tr>";
$trend = "</tr>";
$tdend = '</td>';
$trbeg = '<tr>';
$trend = '</tr>';
// Parse the parameters
extract ($params,EXTR_SKIP);
if (isset($headclass)) {
if (strpos($headclass,'"')) $headclass = str_replace('"',"'",$class);
$tdhdr = "<td class=\"heading $headclass\">";
$tdhdr = "<td class=\"heading $headclass\"";
} else {
$tdhdr = "<td class=\"heading\">";
$tdhdr = '<td class="heading"';
}
if (isset($head)) {
$parts = explode("~|~", $head);
if (strpos($head, '~|~') !== FALSE) {
$separator = '~|~';
} elseif (strpos($head, '|') !== FALSE) {
$separator = '|';
}
$parts = explode($separator, $head);
$row = "";
$row = '';
foreach ($parts as $column) {
$row .= $tdhdr . $column . $tdend;
$tdhdrmid = '';
if (preg_match_all("/^[\/]+/", $column, $matches)) {
$tdhdrmid = ' colspan="' . strlen($matches[0][0]) . '">';
$column = substr($column, strlen($matches[0][0]));
} elseif (preg_match_all("/^[\\\\]+/", $column, $matches)) {
$tdhdrmid = ' rowspan="' . strlen($matches[0][0]) . '">';
$column = substr($column, strlen($matches[0][0]));
} else {
$tdhdrmid = '>';
}
$row .= $tdhdr . $tdhdrmid . $column . $tdend;
}
$wret .= $trbeg . $row . $trend;
......@@ -76,29 +93,45 @@ function wikiplugin_fancytable($data, $params) {
// Each line of the data is a row, the first line is the header
$row_is_odd = true;
$lines = split("\n", $data);
if (strpos($data, '~|~') !== FALSE) {
$separator = '~|~';
} elseif (strpos($data, '|') !== FALSE) {
$separator = '|';
}
foreach ($lines as $line) {
$line = trim($line);
if (strlen($line) > 0) {
if ($row_is_odd) {
$tdbeg = "<td class=\"odd\">";
$tdbeg = '<td class="odd"';
$row_is_odd = false;
} else {
$tdbeg = "<td class=\"even\">";
$tdbeg = '<td class="even"';
$row_is_odd = true;
}
$parts = explode("~|~", $line);
$row = "";
$parts = explode($separator, $line);
$row = '';
foreach ($parts as $column) {
if (strcmp(trim($column), "~blank~") == 0) {
$row .= $tdbeg . "&nbsp;" . $tdend;
$tdmid = '';
if (preg_match_all("/^[\/]+/", $column, $matches)) {
$tdmid = ' colspan="' . strlen($matches[0][0]) . '">';
$column = substr($column, strlen($matches[0][0]));
} elseif (preg_match_all("/^[\\\\]+/", $column, $matches)) {
$tdmid = ' rowspan="' . strlen($matches[0][0]) . '">';
$column = substr($column, strlen($matches[0][0]));
} else {
$tdmid = '>';
}
if (strcmp(trim($column), '~blank~') == 0) {
$row .= $tdbeg . '&nbsp;' . $tdend;
} else {
$row .= $tdbeg . $column . $tdend;
$row .= $tdbeg . $tdmid . $column . $tdend;
}
}
......@@ -107,7 +140,7 @@ function wikiplugin_fancytable($data, $params) {
}
// End the table
$wret .= "</table>";
$wret .= '</table>';
return $wret;
}
}
\ No newline at end of file
......@@ -16,6 +16,24 @@ function wikiplugin_youtube_info() {
'name' => 'Movie',
'description' => tra('URL to the Youtube video'),
),
'width' => array(
'required' => false,
'name' => tra('width'),
'description' => tra('Width in pixels'),
'default' => 425,
),
'height' => array(
'required' => false,
'name' => tra('height'),
'description' => tra('Height in pixels'),
'default' => 350,
),
'quality' => array(
'required' => false,
'name' => tra('quality'),
'description' => tra('quality'),
'default' => 'high',
),
),
);
}
......
......@@ -19,6 +19,7 @@ function module_breadcrumb_info() {
'filter' => 'int'
),
),
'common_params' => array('nonums', 'rows')
);
}
......
......@@ -12,7 +12,7 @@ function module_featured_links_info() {
'description' => tra('Displays the site\'s first featured links.'),
'prefs' => array( 'feature_featuredLinks' ),
'params' => array(),
'common_params' => array('nonums')
'common_params' => array('nonums', 'rows')
);
}
......
......@@ -17,7 +17,7 @@ function module_forums_last_posts_info() {
'description' => tra('If set to "y", only displays topics.') . " " . tr('Not set by default.')
)
),
'common_params' => array('nonums')
'common_params' => array('nonums', 'rows')
);
}
......
......@@ -12,7 +12,7 @@ function module_forums_most_commented_forums_info() {
'description' => tra('Displays the specified number of the forums with the most comments.'),
'prefs' => array( 'feature_forums' ),
'params' => array(),
'common_params' => array('nonums')
'common_params' => array('nonums', 'rows')
);
}
......
......@@ -12,7 +12,7 @@ function module_forums_most_read_topics_info() {
'description' => tra('Displays the specified number of the forum topics with the most reads.'),
'prefs' => array( 'feature_forums' ),
'params' => array(),
'common_params' => array('nonums')
'common_params' => array('nonums', 'rows')
);
}
......
......@@ -12,7 +12,7 @@ function module_forums_most_visited_forums_info() {
'description' => tra('Displays the specified number of the forums with the most visits.'),
'prefs' => array( 'feature_forums' ),
'params' => array(),
'common_params' => array('nonums')
'common_params' => array('nonums', 'rows')
);
}
......
{if $prefs.feature_freetags eq 'y' and $tiki_p_view_freetags eq 'y' and isset($freetags.data[0])}
<div class="freetaglist">{tr}Tags{/tr}:
{foreach from=$freetags.data item=taginfo}
<a class="freetag" href="tiki-browse_freetags.php?tag={$taginfo.tag}">{$taginfo.tag}</a>
<a class="freetag" href="tiki-browse_freetags.php?tag={$taginfo.tag}">{$taginfo.tag|escape}</a>
{if isset($deleteTag) and $tiki_p_admin eq 'y'}
(<a href="{$smarty.server.REQUEST_URI}{if strstr($smarty.server.REQUEST_URI, '?')}&amp;{else}?{/if}delTag={$taginfo.tag|escape:'url'}">x</a>)
{/if}
......
......@@ -73,24 +73,6 @@
<div class="adminoptionlabel"><label for="generate_password">{tr}Include &quot;Generate Password&quot; option on registration form{/tr}.</label></div>
</div>
<div class="adminoptionbox">
<div class="adminoption"><input id="userTracker" type="checkbox" name="userTracker" {if $prefs.userTracker eq 'y'}checked="checked"{/if} {if $prefs.feature_trackers ne 'y'}disabled="disabled" {/if}/></div>
<div class="adminoptionlabel"><label for="userTracker">{tr}Use tracker to collect more user information{/tr}.</label> {if $prefs.feature_help eq 'y'} {help url="User+Tracker"}{/if} <br />
{if $prefs.feature_trackers ne 'y'}<span>{icon _id=information} {tr}Feature is disabled{/tr}. <a href="tiki-admin.php?page=features" title="{tr}Features{/tr}">{tr}Enable now{/tr}.</a></span>
{else}<em>{tr}Use the <strong><a href="tiki-admingroups.php" title="Admin Groups">Admin: Groups</a></strong> page to select which tracker and fields to display{/tr}.</em>
{/if}
</div>
</div>
<div class="adminoptionbox">
<div class="adminoption"><input type="checkbox" id="groupTracker" name="groupTracker" {if $prefs.groupTracker eq 'y'}checked="checked"{/if} {if $prefs.userTracker eq 'y'}checked="checked"{/if} {if $prefs.feature_trackers ne 'y'}disabled="disabled" {/if}/></div>
<div class="adminoptionlabel"><label for="groupTracker">{tr}Use tracker to collect more group information{/tr}.</label> {if $prefs.feature_help eq 'y'} {help url="User+Tracker"}{/if} <br />
{if $prefs.feature_trackers ne 'y'}<span>{icon _id=information} {tr}Feature is disabled{/tr}. <a href="tiki-admin.php?page=features" title="{tr}Features{/tr}">{tr}Enable now{/tr}.</a></span>
{else}<em>{tr}Use the <strong><a href="tiki-admingroups.php" title="Admin Groups">Admin: Groups</a></strong> page to select which tracker and fields to display{/tr}.</em>
{/if}
</div>
</div>
<div class="adminoptionbox">
<div class="adminoptionlabel"><label for="registration_choices">{tr}Users can select a group to join at registration{/tr}:</label>
<br /><em>{tr}By default, new users automatically join the Registered group{/tr}.</em>
......@@ -107,6 +89,24 @@
</div>
</div>
<div class="adminoptionbox">
<div class="adminoption"><input id="userTracker" type="checkbox" name="userTracker" {if $prefs.userTracker eq 'y'}checked="checked"{/if} {if $prefs.feature_trackers ne 'y'}disabled="disabled" {/if}/></div>
<div class="adminoptionlabel"><label for="userTracker">{tr}Use tracker to collect more user information{/tr}.</label> {if $prefs.feature_help eq 'y'} {help url="User+Tracker"}{/if} <br />
{if $prefs.feature_trackers ne 'y'}<span>{icon _id=information} {tr}Feature is disabled{/tr}. <a href="tiki-admin.php?page=features" title="{tr}Features{/tr}">{tr}Enable now{/tr}.</a></span>
{else}<em>{tr}Use the <strong><a href="tiki-admingroups.php" title="Admin Groups">Admin: Groups</a></strong> page to select which tracker and fields to display{/tr}.</em>
{/if}
</div>
</div>
<div class="adminoptionbox">
<div class="adminoption"><input type="checkbox" id="groupTracker" name="groupTracker" {if $prefs.groupTracker eq 'y'}checked="checked"{/if} {if $prefs.userTracker eq 'y'}checked="checked"{/if} {if $prefs.feature_trackers ne 'y'}disabled="disabled" {/if}/></div>
<div class="adminoptionlabel"><label for="groupTracker">{tr}Use tracker to collect more group information{/tr}.</label> {if $prefs.feature_help eq 'y'} {help url="User+Tracker"}{/if} <br />
{if $prefs.feature_trackers ne 'y'}<span>{icon _id=information} {tr}Feature is disabled{/tr}. <a href="tiki-admin.php?page=features" title="{tr}Features{/tr}">{tr}Enable now{/tr}.</a></span>
{else}<em>{tr}Use the <strong><a href="tiki-admingroups.php" title="Admin Groups">Admin: Groups</a></strong> page to select which tracker and fields to display{/tr}.</em>
{/if}
</div>
</div>
<div class="adminoptionbox">
<div class="adminoptionlabel"><label for="email_due">{tr}Re-validate user by email after{/tr}</label> <input type="text" name="email_due" id="email_due" value="{$prefs.email_due|escape}" size="5" /> {tr}days{/tr}.
<br /><em>{tr}Use <strong>-1</strong> for never{/tr}.</em></div>
......
......@@ -339,7 +339,7 @@ function showDetails( id, domain, profile ) { // {{{
<fieldset><legend>{tr}Profile tester{/tr}</legend>
<form action="tiki-admin.php?page=profiles" method="post">
{remarksbox type="warning" title="{tr}Warning{/tr}"}
Paste or type wiki markup and YAML (including the {CODE} tags) into the text area below<br />
Paste or type wiki markup and YAML (including the {literal}{CODE}{/literal} tags) into the text area below<br />
<em><strong>{tr}This will run the profile and make potentially unrecoverable changes in your database!{/tr}</strong></em>
<div class="adminoptionbox">
<div class="adminoptionlabel">
......
......@@ -10,6 +10,18 @@
{/if}
</div>
{if !empty($missing_params)}
<div class="simplebox highlight">
{tr}The following required parameters are missing:{/tr}
<br/>
{section name=ix loop=$missing_params}
{$missing_params[ix]}
{if !$smarty.section.ix.last},&nbsp;{/if}
{/section}
</div>
<br />
{/if}
{tabset name='tabs_adminmodules'}
{tab name='{tr}Assign/Edit modules{/tr}'}
......@@ -156,16 +168,18 @@
<input type="text" id="assign_cache" name="assign_cache" value="{$assign_cache|escape}" />
</td>
</tr>
<tr>
<td class="formcolor"><label for="assign_rows">{tr}Rows{/tr}</label></td>
<td class="formcolor">
<input type="text" id="assign_rows" name="assign_rows" value="{$assign_rows|escape}" />
</td>
</tr>
{if !isset($assign_info.type) or $assign_info.type neq 'function'}
<tr>
<td class="formcolor"><label for="assign_rows">{tr}Rows{/tr}</label></td>
<td class="formcolor">
<input type="text" id="assign_rows" name="assign_rows" value="{$assign_rows|escape}" />
</td>
</tr>
{/if}
{if isset($assign_info.type) and $assign_info.type eq 'function'}
{foreach from=$assign_info.params key=name item=param}
<tr>
<td class="formcolor"><label for="assign_params[{$name|escape}]">{$param.name|escape}</label></td>
<td class="formcolor"><label for="assign_params[{$name|escape}]">{$param.name|escape}{if $param.required} <span class="attention">({tr}required{/tr})</span>{/if}</label></td>
<td class="formcolor">
<input type="text" id="assign_params[{$name|escape}]" name="assign_params[{$name|escape}]" value="{$param.value|escape}"/>
<div class="description">
......
......@@ -259,7 +259,7 @@ function searchrep() {
{/if}
{if $prefs.feature_freetags eq 'y' and $tiki_p_freetags_tag eq 'y'}
<fieldset>
<legend>{tr}Freetags{/tr}</a></legend>
<legend>{tr}Freetags{/tr}</legend>
<table>
{include file='freetag.tpl'}
</table>
......@@ -267,7 +267,7 @@ function searchrep() {
{/if}
{if $prefs.feature_wiki_icache eq 'y'}
<fieldset>
<legend>{tr}Cache{/tr}</a></legend>
<legend>{tr}Cache{/tr}</legend>
<select id="wiki_cache" name="wiki_cache">
<option value="0" {if $prefs.wiki_cache eq 0}selected="selected"{/if}>0 ({tr}no cache{/tr})</option>
<option value="60" {if $prefs.wiki_cache eq 60}selected="selected"{/if}>1 {tr}minute{/tr}</option>
......@@ -282,7 +282,7 @@ function searchrep() {
{/if}
{if $prefs.feature_contribution eq 'y'}
<fieldset>
<legend>{tr}Contributions{/tr}</a></legend>
<legend>{tr}Contributions{/tr}</legend>
<table>
{include file='contribution.tpl'}
</table>
......
......@@ -78,7 +78,6 @@ if (!empty($_REQUEST['edit_assign'])) {
//$smarty->assign_by_ref('assign_title',$info["title"]);
$smarty->assign_by_ref('assign_position', $info["position"]);
$smarty->assign_by_ref('assign_cache', $info["cache_time"]);
$smarty->assign_by_ref('assign_rows', $info["rows"]);
$smarty->assign_by_ref('assign_type', $info["type"]);
$smarty->assign_by_ref('assign_order', $cosa);
$smarty->assign_by_ref('info', $info);
......@@ -88,8 +87,13 @@ if (!empty($_REQUEST['edit_assign'])) {
$modinfo = $modlib->get_module_info( $info['name'] );
$modlib->dispatchValues( $info['params'], $modinfo['params'] );
if ($modinfo["type"] == "include")
if ($modinfo["type"] != "function") {
$smarty->assign_by_ref('assign_rows', $info["rows"]);
$smarty->assign_by_ref('assign_params', $info["params"]); // For old-style modules
} else {
if (isset($modinfo['params']['rows']))
$modinfo['params']['rows']['value'] = $info["rows"];
}
$smarty->assign('assign_info', $modinfo);
}
if (!empty($_REQUEST['unassign'])) {
......@@ -142,6 +146,15 @@ if (isset($_REQUEST["um_update"])) {
if (!isset($_REQUEST["groups"])) {
$_REQUEST["groups"] = array();
}
if (isset($_REQUEST["assign"]) || isset($_REQUEST["preview"])) { // Verify that required parameters are present
$missing_params = array();
$modinfo = $modlib->get_module_info( $_REQUEST['assign_name'] );
foreach($modinfo["params"] as $pname => $param) {
if ($param["required"] && empty($_REQUEST["assign_params"][$pname]))
$missing_params[] = $param["name"];
}
$smarty->assign('missing_params', $missing_params);
}
$smarty->assign('preview', 'n');
if (isset($_REQUEST["preview"])) {
check_ticket('admin-modules');
......@@ -171,14 +184,16 @@ if (isset($_REQUEST["preview"])) {
$phpfuncfile = 'modules/mod-func-' . $_REQUEST["assign_name"] . '.php';
$template = 'modules/mod-' . $_REQUEST["assign_name"] . '.tpl';
if (file_exists($phpfile)) {
$module_rows = $_REQUEST["assign_rows"];
include ($phpfile);
} elseif (file_exists($phpfuncfile)) {
$module_rows = $_REQUEST["assign_rows"];
if (isset($_REQUEST["assign_params"]["rows"]))
$module_rows = $_REQUEST["assign_params"]["rows"];
else
$module_rows = 10;
include_once ($phpfuncfile);
$function = 'module_' . $_REQUEST["assign_name"];
if( function_exists( $function ) ) {
$function( array("name" => $_REQUEST["assign_name"], "position" => $_REQUEST["assign_position"], "ord" => $_REQUEST["assign_order"], "cache_time" => $_REQUEST["assign_cache"], "rows" => $_REQUEST["assign_rows"]), $_REQUEST["assign_params"] ); // Warning: First argument should have all tiki_modules table fields. This is just a best effort
$function( array("name" => $_REQUEST["assign_name"], "position" => $_REQUEST["assign_position"], "ord" => $_REQUEST["assign_order"], "cache_time" => $_REQUEST["assign_cache"], "rows" => $module_rows), $_REQUEST["assign_params"] ); // Warning: First argument should have all tiki_modules table fields. This is just a best effort.
}
}
......@@ -196,7 +211,8 @@ if (isset($_REQUEST["preview"])) {
$smarty->assign_by_ref('assign_position', $_REQUEST["assign_position"]);
$smarty->assign_by_ref('assign_order', $_REQUEST["assign_order"]);
$smarty->assign_by_ref('assign_cache', $_REQUEST["assign_cache"]);
$smarty->assign_by_ref('assign_rows', $_REQUEST["assign_rows"]);
if (isset($_REQUEST["assign_rows"]))
$smarty->assign_by_ref('assign_rows', $_REQUEST["assign_rows"]);
$module_groups = $_REQUEST["groups"];
$grps = '';
foreach($module_groups as $amodule) {
......@@ -205,7 +221,6 @@ if (isset($_REQUEST["preview"])) {
$smarty->assign('module_groups', $grps);
$smarty->assign_by_ref('preview_data', $data);
$modinfo = $modlib->get_module_info( $_REQUEST['assign_name'] );
$modlib->dispatchValues( $_REQUEST['assign_params'], $modinfo['params'] );
$smarty->assign( 'assign_info', $modinfo );
}
......@@ -213,12 +228,18 @@ if (isset($_REQUEST["assign"])) {
check_ticket('admin-modules');
$_REQUEST["assign"] = urldecode($_REQUEST["assign"]);
$smarty->assign_by_ref('assign_name', $_REQUEST["assign_name"]);
//$smarty->assign_by_ref('assign_title',$_REQUEST["assign_title"]);
$smarty->assign_by_ref('assign_position', $_REQUEST["assign_position"]);
$smarty->assign_by_ref('assign_params', $_REQUEST["assign_params"]);
$smarty->assign_by_ref('assign_order', $_REQUEST["assign_order"]);
$smarty->assign_by_ref('assign_cache', $_REQUEST["assign_cache"]);
$smarty->assign_by_ref('assign_rows', $_REQUEST["assign_rows"]);
if (isset($_REQUEST["assign_rows"])) {
$module_rows = $_REQUEST["assign_rows"];
$smarty->assign_by_ref('assign_rows', $_REQUEST["assign_rows"]);
} elseif (isset($_REQUEST["assign_params"]["rows"]))
$module_rows = $_REQUEST["assign_params"]["rows"];
else
$module_rows = 10;
$smarty->assign_by_ref('assign_type', $_REQUEST["assign_type"]);
$module_groups = $_REQUEST["groups"];
$grps = '';
......@@ -226,10 +247,16 @@ if (isset($_REQUEST["assign"])) {
$grps = $grps . " $amodule ";
}
$smarty->assign('module_groups', $grps);
$modlib->assign_module(isset($_REQUEST['moduleId']) ? $_REQUEST['moduleId'] : 0, $_REQUEST["assign_name"], '', $_REQUEST["assign_position"], $_REQUEST["assign_order"], $_REQUEST["assign_cache"], $_REQUEST["assign_rows"], serialize($module_groups) , $_REQUEST["assign_params"], $_REQUEST["assign_type"]);
$logslib->add_log('adminmodules', 'assigned module ' . $_REQUEST["assign_name"]);
header("location: tiki-admin_modules.php");
if (empty($missing_params)) {
$modlib->assign_module(isset($_REQUEST['moduleId']) ? $_REQUEST['moduleId'] : 0, $_REQUEST["assign_name"], '', $_REQUEST["assign_position"], $_REQUEST["assign_order"], $_REQUEST["assign_cache"], $module_rows, serialize($module_groups) , $_REQUEST["assign_params"], $_REQUEST["assign_type"]);
$logslib->add_log('adminmodules', 'assigned module ' . $_REQUEST["assign_name"]);
header("location: tiki-admin_modules.php");
} else {
$modlib->dispatchValues( $_REQUEST['assign_params'], $modinfo['params'] );
$smarty->assign( 'assign_info', $modinfo );
}
}
if (isset($_REQUEST["um_remove"])) {
check_ticket('admin-modules');
$_REQUEST["um_remove"] = urldecode($_REQUEST["um_remove"]);
......
......@@ -306,7 +306,7 @@ if (isset($_REQUEST["save"])) {
$tracker_options['descriptionIsParsed'] = 'n';
}
$_REQUEST["trackerId"] = $trklib->replace_tracker($_REQUEST['trackerId'], $_REQUEST['name'], $_REQUEST['description'], $tracker_options, isset($_REQUEST['descriptionIsParsed']) ? 'y' : '');
$groupalertlib->AddGroup('tracker', $_REQUEST['trackerId'], $_REQUEST['groupforAlert'], !empty($_REQUEST['showeachuser']) ? $_REQUEST['showeachuser'] : 'n');
$groupalertlib->AddGroup('tracker', $_REQUEST['trackerId'], !empty($_REQUEST['groupforAlert'])?$_REQUEST['groupforAlert']:'', !empty($_REQUEST['showeachuser']) ? $_REQUEST['showeachuser'] : 'n');
$logslib->add_log('admintrackers', 'changed or created tracker ' . $_REQUEST["name"]);
$cat_desc = $_REQUEST["description"];
$cat_name = $_REQUEST["name"];
......
......@@ -149,11 +149,20 @@ if (empty($_REQUEST['CR'])) {
}
$smarty->assign_by_ref('CR', $_REQUEST['CR']);
if (!empty($_REQUEST['file'])) {
if (!empty($_REQUEST['debug'])) {
$fp = fopen($prefs['tmpDir'].'/'.tra('tracker')."_".$_REQUEST['trackerId'].".csv", 'w');
} else {
header("Content-type: text/comma-separated-values; charset:".$_REQUEST['encoding']);
header("Content-Disposition: attachment; filename=".tra('tracker')."_".$_REQUEST['trackerId'].".csv");
if (!empty($_REQUEST['file'])) {
if (preg_match('/.csv$/', $_REQUEST['file'])) {
$file = $_REQUEST['file'];
} else {
$file = $_REQUEST['file'].'.csv';
}
} else {
$file = tra('tracker').'_'.$_REQUEST['trackerId'].'.csv';
}
header("Content-Disposition: attachment; filename=$file");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
......
......@@ -97,7 +97,7 @@ if( $prefs['feature_wiki_structure'] == 'y' ) {
}
//If a structure page isnt going to be displayed
if (!empty($page_ref_id)) {
if (empty($page_ref_id)) {
//Check to see if its a member of any structures
if (isset($_REQUEST['structure']) && !empty($_REQUEST['structure'])) {
$struct=$_REQUEST['structure'];
......@@ -106,7 +106,7 @@ if( $prefs['feature_wiki_structure'] == 'y' ) {
}
//Get the structures this page is a member of
$structs = $structlib->get_page_structures($_REQUEST["page"],$struct);
$structs_with_perms = Perms::filter( array( 'type' => 'wiki page' ), 'object', $structs, array( 'object' => 'permName' ), 'view' );
$structs_with_perm = Perms::filter( array( 'type' => 'wiki page' ), 'object', $structs, array( 'object' => 'permName' ), 'view' );
//If page is only member of one structure, display if requested
$single_struct = count($structs_with_perm) == 1;
......
......@@ -279,10 +279,12 @@ if (!empty($multiprint_pages)) {
}
}
function setLangFilter($filter) {
global $smarty;
global $multilinguallib;
global $smarty, $prefs, $multilinguallib;
include_once ('lib/multilingual/multilinguallib.php');
$lang = $multilinguallib->currentSearchLanguage(false);
if (isset($_REQUEST['listonly']) && $prefs['feature_jquery_autocomplete'] == 'y' && strlen($lang) > 2) {
$lang = substr($lang, 0, 2); // for autocomplete - use only language filter, not culture as well
}
$filter['lang'] = $lang;
$smarty->assign_by_ref('find_lang', $lang);
return $filter;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment