本文整理汇总了PHP中Area::getHandleList方法的典型用法代码示例。如果您正苦于以下问题:PHP Area::getHandleList方法的具体用法?PHP Area::getHandleList怎么用?PHP Area::getHandleList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Area
的用法示例。
在下文中一共展示了Area::getHandleList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
public function view($updated = false)
{
Loader::library('database_indexed_search');
if ($this->post('reindex')) {
IndexedSearch::clearSearchIndex();
$this->redirect('/dashboard/system/seo/search_index', 'index_cleared');
} else {
if ($updated) {
$this->set('message', t('Search Index Preferences Updated'));
}
if ($this->isPost()) {
if ($this->token->validate('update_search_index')) {
$areas = $this->post('arHandle');
if (!is_array($areas)) {
$areas = array();
}
Config::save('SEARCH_INDEX_AREA_LIST', serialize($areas));
Config::save('SEARCH_INDEX_AREA_METHOD', Loader::helper('security')->sanitizeString($this->post('SEARCH_INDEX_AREA_METHOD')));
$this->redirect('/dashboard/system/seo/search_index', 'updated');
} else {
$this->set('error', array($this->token->getErrorMessage()));
}
}
$areas = Area::getHandleList();
$selectedAreas = array();
$this->set('areas', $areas);
$this->set('selectedAreas', IndexedSearch::getSavedSearchableAreas());
}
}
示例2: getBodyContentFromPage
public function getBodyContentFromPage($c)
{
$searchableAreaNamesInitial = $this->getSavedSearchableAreas();
foreach ($this->searchableAreaNamesManual as $sm) {
$searchableAreaNamesInitial[] = $sm;
}
$searchableAreaNames = array();
if ($this->getSearchableAreaAction() == 'blacklist') {
$areas = Area::getHandleList();
foreach ($areas as $arHandle) {
if (!in_array($arHandle, $searchableAreaNamesInitial)) {
$searchableAreaNames[] = $arHandle;
}
}
} else {
$searchableAreaNames = $searchableAreaNamesInitial;
}
if (count($searchableAreaNames) == 0) {
return false;
}
$text = '';
$tagsToSpaces = array('<br>', '<br/>', '<br />', '<p>', '</p>', '</ p>', '<div>', '</div>', '</ div>', ' ');
$blarray = array();
$db = Loader::db();
$r = $db->Execute('select bID, arHandle from CollectionVersionBlocks where cID = ? and cvID = ?', array($c->getCollectionID(), $c->getVersionID()));
$th = Loader::helper('text');
while ($row = $r->FetchRow()) {
if (in_array($row['arHandle'], $searchableAreaNames)) {
$b = Block::getByID($row['bID'], $c, $row['arHandle']);
if (!is_object($b)) {
continue;
}
$bi = $b->getInstance();
$bi->bActionCID = $c->getCollectionID();
if (method_exists($bi, 'getSearchableContent')) {
$searchableContent = $bi->getSearchableContent();
if (strlen(trim($searchableContent))) {
$text .= $th->decodeEntities(strip_tags(str_ireplace($tagsToSpaces, ' ', $searchableContent)), ENT_QUOTES, APP_CHARSET) . ' ';
}
}
unset($b);
unset($bi);
}
}
$returned_text = Events::fire('on_page_body_index', $c, $text);
if ($returned_text !== null && $returned_text !== false) {
$text = $returned_text;
}
return $text;
}
示例3: manage_index
public function manage_index()
{
Loader::library('database_indexed_search');
if ($this->isPost()) {
$areas = $this->post('arHandle');
if (!is_array($areas)) {
$areas = array();
}
Config::save('SEARCH_INDEX_AREA_LIST', serialize($areas));
Config::save('SEARCH_INDEX_AREA_METHOD', $this->post('SEARCH_INDEX_AREA_METHOD'));
$this->redirect('/dashboard/sitemap/search', 'index_settings_updated');
}
$areas = Area::getHandleList();
$selectedAreas = array();
$this->set('areas', $areas);
$this->set('selectedAreas', IndexedSearch::getSavedSearchableAreas());
}