public function run() { Cache::disableCache(); Loader::library('database_indexed_search'); $is = new IndexedSearch(); if ($_GET['force'] == 1) { Loader::model('attribute/categories/collection'); Loader::model('attribute/categories/file'); Loader::model('attribute/categories/user'); $attributes = CollectionAttributeKey::getList(); $attributes = array_merge($attributes, FileAttributeKey::getList()); $attributes = array_merge($attributes, UserAttributeKey::getList()); foreach($attributes as $ak) { $ak->updateSearchIndex(); } $result = $is->reindexAll(true); } else { $result = $is->reindexAll(); } if ($result->count == 0) { return t('Indexing complete. Index is up to date'); } else { if ($result->count == $is->searchBatchSize) { return t('Index partially updated. %s pages indexed (maximum number.) Re-run this job to continue this process.', $result->count); } else { return t('Index updated. %s %s required reindexing.', $result->count, $result->count == 1 ? t('page') : t('pages')); } } }
public function run() { Cache::disableAll(); $is = new IndexedSearch(); if ($_GET['force'] == 1) { $attributes = \CollectionAttributeKey::getList(); $attributes = array_merge($attributes, \FileAttributeKey::getList()); $attributes = array_merge($attributes, \UserAttributeKey::getList()); foreach ($attributes as $ak) { $ak->updateSearchIndex(); } $result = $is->reindexAll(true); } else { $result = $is->reindexAll(); } if ($result->count == 0) { return t('Indexing complete. Index is up to date'); } else { if ($result->count == $is->searchBatchSize) { return t('Index partially updated. %s pages indexed (maximum number.) Re-run this job to continue this process.', $result->count); } else { return t('Index updated.') . ' ' . t2('%d page required reindexing.', '%d pages required reindexing.', $result->count, $result->count); } } }
public function start(Zend_Queue $q) { Loader::library('database_indexed_search'); $this->is = new IndexedSearch(); Loader::model('attribute/categories/collection'); Loader::model('attribute/categories/file'); Loader::model('attribute/categories/user'); $attributes = CollectionAttributeKey::getList(); $attributes = array_merge($attributes, FileAttributeKey::getList()); $attributes = array_merge($attributes, UserAttributeKey::getList()); foreach ($attributes as $ak) { $ak->updateSearchIndex(); } $db = Loader::db(); $db->Execute('truncate table PageSearchIndex'); $r = $db->Execute('select Pages.cID from Pages left join CollectionSearchIndexAttributes csia on Pages.cID = csia.cID where (ak_exclude_search_index is null or ak_exclude_search_index = 0) and cIsActive = 1'); while ($row = $r->FetchRow()) { $q->send($row['cID']); } }
if ($_POST['task'] == 'update_columns') { $fdc = new FileManagerColumnSet(); foreach($_POST['column'] as $key) { $fdc->addColumn($fldca->getColumnByKey($key)); } $sortCol = $fldca->getColumnByKey($_POST['fSearchDefaultSort']); $fdc->setDefaultSortColumn($sortCol, $_POST['fSearchDefaultSortDirection']); $u->saveConfig('FILE_LIST_DEFAULT_COLUMNS', serialize($fdc)); $fileList = new FileList(); $fileList->resetSearchRequest(); exit; } $list = FileAttributeKey::getList(); ?> <div class="ccm-ui"> <form method="post" id="ccm-<?php echo $searchInstance; ?> -customize-search-columns-form" action="<?php echo REL_DIR_FILES_TOOLS_REQUIRED; ?> /files/customize_search_columns/"> <?php echo $form->hidden('task', 'update_columns'); ?>
?> </h4> <?php if ($previewMode) { $mode = 'preview'; } ?> <?php Loader::element('files/properties', array('fv' => $fv, 'mode' => $mode)); ?> </section> <?php $attribs = FileAttributeKey::getList(); if (count($attribs) > 0) { ?> <section> <h4><?php echo t('Attributes'); ?> </h4> <?php Loader::element('attribute/editable_list', array('attributes' => $attribs, 'object' => $f, 'saveAction' => $controller->action('update_attribute'), 'clearAction' => $controller->action('clear_attribute'), 'permissionsArguments' => $fp->canEditFileProperties(), 'permissionsCallback' => function ($ak, $permissionsArguments) { return $permissionsArguments; })); ?>
public function view() { $attribs = FileAttributeKey::getList(); $this->set('attribs', $attribs); }