Esempio n. 1
0
	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'));
			}
		}
	}
Esempio n. 2
0
 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 save($data)
 {
     //parent::save($data);
     $db = Loader::db();
     $page = Page::getCurrentPage();
     $cID = $page->getCollectionID();
     $page = Page::getByID($cID);
     $page->update(array('cName' => $_REQUEST['collectionName']));
     $collectionAttributes = CollectionAttributeKey::getList();
     foreach ($collectionAttributes as $collectionAttribute) {
         if (array_key_exists($collectionAttribute->akID, $_REQUEST['akID'])) {
             $collectionAttribute->setAttribute($page, false);
         }
     }
 }
 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']);
     }
 }
Esempio n. 5
0
	<?php 
        echo Loader::helper('concrete/dashboard')->getDashboardPaneFooterWrapper(false);
        ?>



<?php 
    } else {
        ?>

	<?php 
        echo Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Page Attributes'), false, false, false);
        ?>

	<?php 
        $attribs = CollectionAttributeKey::getList();
        Loader::element('dashboard/attributes_table', array('category' => $category, 'attribs' => $attribs, 'editURL' => '/dashboard/pages/attributes'));
        ?>

	<div class="ccm-pane-body ccm-pane-body-footer" style="margin-top: -25px">
	
	<form method="get" class="form-stacked inline-form-fix" action="<?php 
        echo $this->action('select_type');
        ?>
" id="ccm-attribute-type-form">
	<div class="clearfix">
	<?php 
        echo $form->label('atID', t('Add Attribute'));
        ?>
	<div class="input">
	
if ($_POST['task'] == 'update_columns') {
	
	$fdc = new PageSearchColumnSet();
	foreach($_POST['column'] as $key) {
		$fdc->addColumn($fldca->getColumnByKey($key));
	}	
	$sortCol = $fldca->getColumnByKey($_POST['fSearchDefaultSort']);
	$fdc->setDefaultSortColumn($sortCol, $_POST['fSearchDefaultSortDirection']);
	$u->saveConfig('PAGE_LIST_DEFAULT_COLUMNS', serialize($fdc));
	
	$pageList = new PageList();
	$pageList->resetSearchRequest();
	exit;
}

$list = CollectionAttributeKey::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;
?>
/pages/customize_search_columns/">
<?php 
echo $form->hidden('task', 'update_columns');
?>
		$requiredKeys[] = $ak->getAttributeKeyID();
	}
}
$setAttribs = $c->getSetCollectionAttributes();
foreach($setAttribs as $ak) {
	$usedKeys[] = $ak->getAttributeKeyID();
}
$usedKeysCombined = array_merge($requiredKeys, $usedKeys);
	
?>

	<h2>
		<?php echo t('Custom Attributes')?> 
		<select id="ccm-meta-custom-fields">
			<option value="">** <?php echo t('Add Attribute')?></option>
			<?php  $cAttributes = CollectionAttributeKey::getList(); 
			foreach($cAttributes as $ck) { 
				if (!in_array($ck->getAttributeKeyID(), $usedKeysCombined) || $c->getCollectionTypeID()==0) {?>
				<option value="<?php echo $ck->getAttributeKeyID()?>"><?php echo $ck->getAttributeKeyName()?></option>
			<?php  }
			
			}?>
		</select>
	</h2><br/>

	<?php  
		ob_start();
		
		$al = Loader::helper('concrete/asset_library');