Commit 7abec8e5 authored by Jonny Bradley's avatar Jonny Bradley

[MRG] Automatic merge, trunk 21215 to 21229

parent f581622e
......@@ -60,8 +60,9 @@ class CalendarLib extends TikiLib {
$mid .= implode( ' and ', $tmp_mid ) . ')';
}
}
$bindvars = array_merge($bindvars, $join_bindvars);
if (is_array($join_bindvars)) {
$bindvars = array_merge($bindvars, $join_bindvars);
}
$query = "select $distinct * from `tiki_calendars` as tcal $join_tables $mid order by tcal.".$this->convertSortMode($sort_mode);
$result = $this->query($query,$bindvars,$maxRecords,$offset);
......
......@@ -310,14 +310,23 @@ function get_objects_with_tag_combo($tagArray, $type='', $thisUser = '', $offset
$ret = array();
$permMap = $categlib->map_object_type_to_permission();
while ($row = $result->fetchRow()) {
if ($tiki_p_admin == 'y' || $this->user_has_perm_on_object($user, $row['itemId'], $row['type'], $permMap[$row['type']])) {
if ($tiki_p_admin == 'y') {
$ret[] = $row;
} elseif ($row['type'] == 'blog post') {
global $bloglig; include_once('lib/blogs/bloglib.php');
$post_info = $bloglib->get_post($row['itemId']);
if ($this->user_has_perm_on_object($user, $post_info['blogId'], 'blog', 'tiki_p_read_blog')) {
$ret[] = $row;
} else {
--$cant;
}
} elseif ($this->user_has_perm_on_object($user, $row['itemId'], $row['type'], $permMap[$row['type']])) {
$ret[] = $row;
} else {
--$cant;
}
}
}
return array('data' => $ret,
'cant' => $cant);
}
......
......@@ -818,8 +818,7 @@ class ToolbarHelptool extends Toolbar
{
$this->setLabel( tra('Wiki Help') )
->setIcon( 'pics/icons/help.png' )
->setWysiwygToken( 'help' )
->setType('Helptool');
->setType('Helptool');
} // }}}
function getWikiHtml( $areaName ) // {{{
......
......@@ -63,22 +63,28 @@ function wikiplugin_mouseover_info() {
'description' => tra('y|n, parse the body of the plugin as wiki content. (Default to y)'),
'filter' => 'alpha',
),
'class' => array(
'required' => false,
'name' => tra('CSS Class'),
'description' => 'Default: plugin-mouseover',
'filter' => 'alpha',
),
'bgcolor' => array(
'required' => false,
'name' => tra('Color of the inside popup'),
'description' => tra('Default: #F5F5F5'),
'name' => tra('Background color of the popup'),
'description' => tra(''),
'filter' => 'striptags',
),
'textcolor' => array(
'required' => false,
'name' => tra('Text popup color'),
'description' => tra('#FFFFFF'),
'name' => tra('Text color in the popup'),
'description' => tra(''),
'filter' => 'striptags',
),
'sticky' => array(
'required' => false,
'name' => tra('Sticky'),
'description' => 'y|n, when enabled, popup stays visible until an other one is displayed or it is clicked.',
'description' => 'y|n, when enabled, popup stays visible until it is clicked.',
'filter' => 'alpha',
),
'padding' => array(
......@@ -87,6 +93,18 @@ function wikiplugin_mouseover_info() {
'description' => 'Default: 5px',
'filter' => 'digits',
),
'effect' => array(
'required' => false,
'name' => tra('Effect'),
'description' => 'Options: None|Default|Slide|Fade (and with jQuery UI enabled: Blind|Clip|Drop|Explode|Fold|Puff|Slide)',
'filter' => 'alpha',
),
'speed' => array(
'required' => false,
'name' => tra('Effect speed'),
'description' => 'Options: Fast|Normal|Slow',
'filter' => 'alpha',
),
),
);
}
......@@ -95,7 +113,7 @@ function wikiplugin_mouseover( $data, $params ) {
global $smarty, $tikilib;
if( ! isset($params['url']) ) {
$url = 'javascript:void()';
$url = 'javascript:void(0)';
} else {
$url = $params['url'];
}
......@@ -106,7 +124,9 @@ function wikiplugin_mouseover( $data, $params ) {
$offsety = isset( $params['offsety'] ) ? (int) $params['offsety'] : 0;
$parse = ! isset($params['parse']) || $params['parse'] != 'n';
$sticky = isset($params['sticky']) && $params['sticky'] == 'y';
$padding = isset( $params['padding'] ) ? (int) $params['padding'] : 5;
$padding = isset( $params['padding'] ) ? 'padding: '.$params['padding'].'px;' : '';
$effect = !isset( $params['effect'] ) || $params['effect'] == 'Default' ? '' : strtolower($params['effect']);
$speed = !isset( $params['speed'] ) ? 'normal' : strtolower($params['speed']);
if (empty($params['label']) && empty($params['text'])) {
$label = tra('No label specified');
......@@ -129,31 +149,21 @@ function wikiplugin_mouseover( $data, $params ) {
global $headerlib;
$headerlib->add_js( "
window.addEvent('domready', function() {
$('$id-link').addEvent( 'mouseover', function(event) {
if( window.wikiplugin_mouseover )
window.wikiplugin_mouseover.setStyle('display', 'none');
window.wikiplugin_mouseover = $('$id');
window.wikiplugin_mouseover.setStyle('left', (event.page.x + $offsetx) + 'px');
window.wikiplugin_mouseover.setStyle('top', (event.page.y + $offsety) + 'px');
window.wikiplugin_mouseover.setStyle('display','block');
window.wikiplugin_mouseover.addEvent( 'click', function(event) {
window.wikiplugin_mouseover.setStyle( 'display', 'none' );
} );
} );
" . ( $sticky ? '' : "
$('$id-link').addEvent( 'mouseout', function(event) {
$('$id').setStyle('display','none');
} ); " ) . "
} );
" );
$bgcolor = "background-color: " . ( isset($params['bgcolor']) ? $params['bgcolor'] : '#F5F5F5' ) . ';';
$textcolor = isset($params['textcolor']) ? ("color:" . $params['textcolor'] . ';') : '';
$html = "~np~<a id=\"$id-link\" href=\"$url\">$label</a><div id=\"$id\" style=\"width: {$width}px; " . (isset($params['height']) ? "height: {$height}px; " : "") . "{$bgcolor} {$textcolor} display:none; padding: {$padding}px ;position: absolute; z-index: 500;\">$text</div>~/np~";
$js = "\$jq('#$id-link').mouseover(function(event) {
\$jq('#$id').css('left', event.pageX + $offsetx).css('top', event.pageY + $offsety); showJQ('#$id', '$effect', '$speed'); });";
if ($sticky) {
$js .= "\$jq('#$id').click(function(event) { hideJQ('#$id', '$effect', '$speed'); }).css('cursor','pointer');\n";
} else {
$js .= "\$jq('#$id-link').mouseout(function(event) { setTimeout(function() {hideJQ('#$id', '$effect', '$speed')}, 250); });";
}
$headerlib->add_jq_onready($js);
$bgcolor = isset($params['bgcolor']) ? ("background-color: " . $params['bgcolor'] . ';') : '';
$textcolor = isset($params['textcolor']) ? ("color:" . $params['textcolor'] . ';') : '';
$class = !isset( $params['class'] ) ? 'class="plugin-mouseover"' : 'class="'.$params['class'].'"';
$html = "~np~<a id=\"$id-link\" href=\"$url\">$label</a>".
"<span id=\"$id\" $class style=\"width: {$width}px; " . (isset($params['height']) ? "height: {$height}px; " : "") ."{$bgcolor} {$textcolor} {$padding} \">$text</span>~/np~";
return $html;
}
......@@ -85,7 +85,7 @@ function wikiplugin_thumb($data, $params) {
$float = "none";
}
if (!isset($url)) {
$url = "javascript:void()";
$url = "javascript:void(0)";
}
if( isset($file) && !empty($file) ) {
......
......@@ -1556,6 +1556,15 @@ ul.floatleft li {
margin-top: 8px;
}
/* mouseover plugin */
.plugin-mouseover {
position: absolute;
z-index: 500;
display:none;
padding: .4em;
}
/** Wiki tocs **/
div.tocnav {
margin-bottom: 4px;
......
......@@ -1268,6 +1268,15 @@ ul.floatleft li {
margin-top: 8px;
}
/* mouseover plugin */
.plugin-mouseover {
position: absolute;
z-index: 500;
display:none;
padding: .4em;
}
/** Wiki tocs **/
div.tocnav {
margin-bottom: 4px;
......
{title help="Menus"}{tr}Admin Menus{/tr}{/title}
{if $tiki_p_admin eq 'y'}
<div class="navbar">
{button href="tiki-admin_modules.php" _text="{tr}Admin Modules{/tr}"}
</div>
{/if}
{tabset name="admin_menus"}
{tab name="{tr}Menus{/tr}"}
{include file='find.tpl'}
......
......@@ -5,6 +5,9 @@
<div class="navbar">
{button href="tiki-admin_modules.php?clear_cache=1" _text="{tr}Clear Cache{/tr}"}
{if $tiki_p_edit_menu eq 'y'}
{button href="tiki-admin_menus.php" _text="{tr}Admin Menus{/tr}"}
{/if}
</div>
{tabset name='tabs_adminmodules'}
......
......@@ -4,9 +4,11 @@
{remarksbox type="tip" title="{tr}Tip{/tr}"}{tr}To use a banner in a <a class="rbox-link" href="tiki-admin_modules.php">module</a> or a template, use {literal}{banner zone=ABC}{/literal}, where ABC is the name of the zone.{/tr}{/remarksbox}
<div class="navbar">
{button href="tiki-edit_banner.php" _text="{tr}Create banner{/tr}"}
</div>
{if $tiki_p_admin_banners eq 'y'}
<div class="navbar">
{button href="tiki-edit_banner.php" _text="{tr}Create banner{/tr}"}
</div>
{/if}
{if $listpages or ($find ne '')}
{include file='find.tpl'}
......
......@@ -37,6 +37,9 @@ if (!isset($_REQUEST['tag']) && $prefs['freetags_preload_random_search'] == 'y')
$tag = $freetaglib->get_tag_suggestion('', 1);
if (!empty($tag[0])) {
$_REQUEST['tag'] = $tag[0];
if (strstr($tag[0], ' ')) {
$_REQUEST['tag'] = '"'.$_REQUEST['tag'].'"';
}
}
}
if (!isset($_REQUEST["sort_mode"])) {
......
......@@ -15,13 +15,7 @@ if ($prefs['feature_banners'] != 'y') {
$smarty->display("error.tpl");
die;
}
// IF NOT LOGGED aND NOT ADMIN BAIL OUT
if ($tiki_p_admin != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("Permission denied"));
$smarty->display("error.tpl");
die;
}
if (isset($_REQUEST["remove"])) {
if ($tiki_p_admin_banners != 'y') {
$smarty->assign('errortype', 401);
......@@ -63,7 +57,11 @@ if (isset($_REQUEST["find"])) {
}
$smarty->assign('find', $find);
// Get a list of last changes to the Wiki database
$who = 'admin';
if ($tiki_p_admin_banners == 'y') {
$who = 'admin';
} else {
$who = $user;
}
$listpages = $bannerlib->list_banners($offset, $maxRecords, $sort_mode, $find, $who);
$smarty->assign_by_ref('cant_pages', $listpages["cant"]);
$smarty->assign_by_ref('listpages', $listpages["data"]);
......
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