Commit 96e6fc09 authored by Jonny Bradley's avatar Jonny Bradley

[MRG] Automatic merge, branches/7.x 34390 to 34402

parent d2fe1312
......@@ -141,7 +141,7 @@ function ajax_preview(editorId, autoSaveId, inPage) {
h = h && h.length ? h[1] : "";
$.get("tiki-auto_save.php", {
editor_id: editorId,
autoSaveId: escape(autoSaveId),
autoSaveId: autoSaveId,
inPage: true,
hdr: h,
allowHtml: allowHtml
......
......@@ -10,10 +10,10 @@ class Search_GlobalSource_PermissionSource implements Search_GlobalSource_Interf
private $perms;
private $additionalCheck;
function __construct(Perms $perms, $additionalCheck = null)
function __construct(Perms $perms, $additionalCheck = array())
{
$this->perms = $perms;
$this->additionalCheck = $additionalCheck;
$this->additionalCheck = (array) $additionalCheck;
}
function getProvidedFields()
......@@ -96,8 +96,9 @@ class Search_GlobalSource_PermissionSource implements Search_GlobalSource_Interf
{
$toCheck = $accessor->getResolver()->applicableGroups();
if ($this->additionalCheck) {
$toCheck[] = $this->additionalCheck;
if (count($this->additionalCheck)) {
$toCheck = array_merge($toCheck, $this->additionalCheck);
$toCheck = array_unique($toCheck);
}
return $toCheck;
......
......@@ -43,10 +43,17 @@ class PorterStemmer
*/
public static function Stem($word)
{
static $cache = array();
if (strlen($word) <= 2) {
return $word;
}
if (isset($cache[$word])) {
return $cache[$word];
}
$initial = $word;
$word = self::step1ab($word);
$word = self::step1c($word);
$word = self::step2($word);
......@@ -54,6 +61,8 @@ class PorterStemmer
$word = self::step4($word);
$word = self::step5($word);
$cache[$initial] = $word;
return $word;
}
......
......@@ -36,7 +36,12 @@ class Tracker_Field_ItemLink extends Tracker_Field_Abstract
$smarty = TikiLib::lib('smarty');
$item = $this->getConfiguration('linkId');
$label = $this->getConfiguration('value');
$dlist = $this->getConfiguration('listdisplay');
if (!empty($dlist)) {
$label = $dlist[$item];
} else {
$label = $this->getConfiguration('value');
}
if ($item && $context['list_mode'] !== 'csv' && $this->getOption(2)) {
require_once $smarty->_get_plugin_filepath('function', 'object_link');
......
......@@ -284,7 +284,7 @@ var showModuleEditForm = function(item, options) {
$(this).find('input[type=text]').removeClass('ui-state-error');
if (bValid) {
//$("#module_edit_div #save_tool").val('Save');
modAdminDirty = false;
$("#module_edit_div form").submit();
$(this).dialog('close');
}
......
......@@ -2075,7 +2075,8 @@ function prefs_feature_list($partial = false) {
'type' => 'flag',
'help' => 'CodeMirror',
'description' => tra('Enables syntax highlighting with the use of CodeMirror'),
'default' => 'y',
'default' => 'n',
'warning' => tra('Experimental. This feature is still under development.'),
),
);
}
......@@ -210,7 +210,10 @@ class UnifiedSearchLib
}
if ($mode == 'indexing') {
$aggregator->addGlobalSource(new Search_GlobalSource_PermissionSource(Perms::getInstance(), 'Admins'));
$adminGroups = TikiDb::get()->table('users_grouppermissions')->fetchColumn('groupName', array(
'permName' => 'tiki_p_admin',
));
$aggregator->addGlobalSource(new Search_GlobalSource_PermissionSource(Perms::getInstance(), $adminGroups));
}
}
......
......@@ -116,6 +116,24 @@ class Search_GlobalSource_PermissionSourceTest extends PHPUnit_Framework_TestCas
$this->assertEquals($typeFactory->multivalue(array('Anonymous', 'Registered', 'Admins')), $document['allowed_groups']);
}
function testWithMultipleAdditionalGroups()
{
$contentSource = new Search_ContentSource_Static(array(
'HomePage' => array('view_permission' => 'tiki_p_view'),
), array('view_permission' => 'identifier'));
$this->globalAlternate->setResolver(new Perms_Resolver_Default(true));
$this->indexer->addGlobalSource(new Search_GlobalSource_PermissionSource($this->perms, array('SubAdmins', 'Admins', 'Registered')));
$this->indexer->addContentSource('wiki page', $contentSource);
$this->indexer->rebuild();
$document = $this->index->getDocument(0);
$typeFactory = $this->index->getTypeFactory();
$this->assertEquals($typeFactory->multivalue(array('Anonymous', 'Registered', 'SubAdmins', 'Admins')), $document['allowed_groups']);
}
function testWithParentPermissionSpecified()
{
$contentSource = new Search_ContentSource_Static(array(
......
......@@ -4289,7 +4289,12 @@ class TikiLib extends TikiDb_Bridge
$smarty->assign( 'plugin_index', $current_index );
$smarty->assign( 'plugin_status', $status );
$smarty->assign( 'plugin_details', $details );
if (!$options['inside_pretty']) {
$smarty->assign( 'plugin_details', $details );
} else {
$smarty->assign( 'plugin_details', '' );
}
$smarty->assign( 'plugin_preview', $preview );
$smarty->assign( 'plugin_approve', $approve );
......
......@@ -103,6 +103,7 @@ function wikiplugin_code($data, $params) {
$code = trim($data);
$code = str_replace('&lt;x&gt;', '', $code);
$code = str_replace('<x>', '', $code);
$parse_wiki = ( isset($wiki) && $wiki == 1 );
$escape_html = ( ! isset($ishtml) || $ishtml != 1 );
......
......@@ -1072,8 +1072,9 @@ function wikiplugin_trackerlist($data, $params) {
}
if (isset($itemId)) {
if (strstr($itemId, ':'))
$itemId = explode(':', $itemId);
if (is_string($itemId) && strstr($itemId, ':')) { // JB Tiki7: This doesn't quite make sense as itemId is an array
$itemId = explode(':', $itemId); // Probably just some redundant code TOKIL
}
$filter['tti.`itemId`'] = $itemId;
}
......
......@@ -178,7 +178,6 @@
<fieldset>
<legend class="heading">{icon _id="star"} <span>{tr}New{/tr}</span></legend>
<p class="description">{tr}These features are relatively new, or recently underwent major renovations. You should expect growing pains and possibly a lack of up to date documentation, as you would of a version 1.0 application{/tr}</p>
{preference name=feature_syntax_highlighter}
{preference name=feature_invite}
{preference name=feature_quick_object_perms}
{preference name=feature_webdav}
......@@ -212,6 +211,7 @@
<fieldset>
<legend class="heading">{icon _id="new"} <span>{tr}Fresh out of the oven{/tr}</span></legend>
{preference name=feature_syntax_highlighter}
{preference name=feature_credits}
{preference name=feature_loadbalancer}
{preference name=feature_socialnetworks}
......
......@@ -63,7 +63,6 @@ if (isset($_REQUEST['editor_id'])) {
send_ajax_response( $_REQUEST['command'], $res );
} else if (isset($_REQUEST['autoSaveId'])) { // wiki page previews
$_REQUEST['autoSaveId'] = urldecode($_REQUEST['autoSaveId']);
$autoSaveIdParts = explode(':', $_REQUEST['autoSaveId']); // user, section, object id
if (count($autoSaveIdParts) === 3 && !empty($user) && $user === $autoSaveIdParts[0] && $autoSaveIdParts[1] === 'wiki_page') {
......
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