public function reindex() { Loader::model('attribute/categories/file'); $attribs = FileAttributeKey::getAttributes($this->getFileID(), $this->getFileVersionID(), 'getSearchIndexValue'); $db = Loader::db(); $db->Execute('delete from FileSearchIndexAttributes where fID = ?', array($this->getFileID())); $searchableAttributes = array('fID' => $this->getFileID()); $rs = $db->Execute('select * from FileSearchIndexAttributes where fID = -1'); AttributeKey::reindex('FileSearchIndexAttributes', $searchableAttributes, $attribs, $rs); }
/** * @see \C5TL\Parser\DynamicItem::parseManual() */ public function parseManual(\Gettext\Translations $translations, $concrete5version) { if (class_exists('\\AttributeKeyCategory', true) && class_exists('\\AttributeKey', true)) { foreach (\AttributeKeyCategory::getList() as $akc) { foreach (\AttributeKey::getList($akc->getAttributeKeyCategoryHandle()) as $ak) { $this->addTranslation($translations, $ak->getAttributeKeyName(), 'AttributeKeyName'); } } } }
public function run() { $this->x = new SimpleXMLElement("<concrete5-cif></concrete5-cif>"); $this->x->addAttribute('version', '1.0'); // First, attribute categories AttributeKeyCategory::exportList($this->x); // attribute types AttributeType::exportList($this->x); // then block types BlockTypeList::exportList($this->x); // now attribute keys (including user) AttributeKey::exportList($this->x); // now attribute keys (including user) AttributeSet::exportList($this->x); // now theme PageTheme::exportList($this->x); // now packages PackageList::export($this->x); // permission access entity types PermissionAccessEntityType::exportList($this->x); // now task permissions PermissionKey::exportList($this->x); // workflow types WorkflowType::exportList($this->x); // now jobs Loader::model('job'); Job::exportList($this->x); // now single pages $singlepages = $this->x->addChild("singlepages"); $db = Loader::db(); $r = $db->Execute('select cID from Pages where cFilename is not null and cFilename <> "" and cID not in (select cID from Stacks) order by cID asc'); while ($row = $r->FetchRow()) { $pc = Page::getByID($row['cID'], 'RECENT'); $pc->export($singlepages); } // now page types CollectionType::exportList($this->x); // now stacks/global areas Loader::model('stack/list'); StackList::export($this->x); // now content pages $pages = $this->x->addChild("pages"); $db = Loader::db(); $r = $db->Execute('select Pages.cID from Pages left join ComposerDrafts on Pages.cID = ComposerDrafts.cID where ComposerDrafts.cID is null and cIsTemplate = 0 and cFilename is null or cFilename = "" order by cID asc'); while ($row = $r->FetchRow()) { $pc = Page::getByID($row['cID'], 'RECENT'); $pc->export($pages); } Loader::model("system/captcha/library"); SystemCaptchaLibrary::exportList($this->x); Config::exportList($this->x); }
/** * @see \C5TL\Parser\DynamicItem::parseManual() */ public function parseManual(\Gettext\Translations $translations, $concrete5version) { if (class_exists('\\AttributeKeyCategory', true) && class_exists('\\AttributeKey', true) && class_exists('\\AttributeType', true)) { foreach (\AttributeKeyCategory::getList() as $akc) { $akcHandle = $akc->getAttributeKeyCategoryHandle(); foreach (\AttributeKey::getList($akcHandle) as $ak) { if ($ak->getAttributeType()->getAttributeTypeHandle() === 'select') { foreach ($ak->getController()->getOptions() as $option) { $this->addTranslation($translations, $option->getSelectAttributeOptionValue(false), 'SelectAttributeValue'); } } } } } }
public function exportAll() { $this->x = $this->getXMLRoot(); // First, attribute categories AttributeKeyCategory::exportList($this->x); // attribute types AttributeType::exportList($this->x); // then block types BlockTypeList::exportList($this->x); // now attribute keys (including user) AttributeKey::exportList($this->x); // now attribute keys (including user) AttributeSet::exportList($this->x); // now theme PageTheme::exportList($this->x); // now packages PackageList::export($this->x); // permission access entity types PermissionAccessEntityType::exportList($this->x); // now task permissions PermissionKey::exportList($this->x); // workflow types WorkflowType::exportList($this->x); // now jobs Loader::model('job'); Job::exportList($this->x); // now single pages $singlepages = $this->x->addChild("singlepages"); $db = Loader::db(); $r = $db->Execute('select cID from Pages where cFilename is not null and cFilename <> "" and cID not in (select cID from Stacks) order by cID asc'); while ($row = $r->FetchRow()) { $pc = Page::getByID($row['cID'], 'RECENT'); $pc->export($singlepages); } // now page types CollectionType::exportList($this->x); // now stacks/global areas Loader::model('stack/list'); StackList::export($this->x); $this->exportPages($this->x); Loader::model("system/captcha/library"); SystemCaptchaLibrary::exportList($this->x); Config::exportList($this->x); }
public function delete() { parent::delete(); $db = Loader::db(); $r = $db->Execute('select avID from FileAttributeValues where akID = ?', array($this->getAttributeKeyID())); while ($row = $r->FetchRow()) { $db->Execute('delete from AttributeValues where avID = ?', array($row['avID'])); } $db->Execute('delete from FileAttributeValues where akID = ?', array($this->getAttributeKeyID())); }
/** * Returns an array of package items (e.g. blocks, themes) */ public function getPackageItems() { $items = array(); Loader::model('single_page'); Loader::library('mail/importer'); Loader::model('job'); Loader::model('collection_types'); Loader::model('system/captcha/library'); Loader::model('system/antispam/library'); $items['attribute_categories'] = AttributeKeyCategory::getListByPackage($this); $items['permission_categories'] = PermissionKeyCategory::getListByPackage($this); $items['permission_access_entity_types'] = PermissionAccessEntityType::getListByPackage($this); $items['attribute_keys'] = AttributeKey::getListByPackage($this); $items['attribute_sets'] = AttributeSet::getListByPackage($this); $items['group_sets'] = GroupSet::getListByPackage($this); $items['page_types'] = CollectionType::getListByPackage($this); $items['mail_importers'] = MailImporter::getListByPackage($this); $items['configuration_values'] = Config::getListByPackage($this); $items['block_types'] = BlockTypeList::getByPackage($this); $items['page_themes'] = PageTheme::getListByPackage($this); $items['permissions'] = PermissionKey::getListByPackage($this); $items['single_pages'] = SinglePage::getListByPackage($this); $items['attribute_types'] = AttributeType::getListByPackage($this); $items['captcha_libraries'] = SystemCaptchaLibrary::getListByPackage($this); $items['antispam_libraries'] = SystemAntispamLibrary::getListByPackage($this); $items['jobs'] = Job::getListByPackage($this); $items['workflow_types'] = WorkflowType::getListByPackage($this); ksort($items); return $items; }
/** * Duplicates an attribute key */ public function duplicate($args = array()) { $ar = new ADODB_Active_Record('AttributeKeys'); $ar->Load('akID=?', array($this->akID)); $ar2 = clone $ar; $ar2->akID = null; foreach ($args as $key => $value) { $ar2->{$key} = $value; } $ar2->Insert(); $db = Loader::db(); $ak = new AttributeKey(); $ak->load($db->Insert_ID()); // now we duplicate the specific category fields $this->getController()->duplicateKey($ak); return $ak; }
<form class="" method="post" action="<?php echo $this->action('update_set_attributes'); ?> "> <input type="hidden" name="asID" value="<?php echo $set->getAttributeSetID(); ?> " /> <?php echo Loader::helper('validation/token')->output('update_set_attributes'); ?> <?php $cat = AttributeKeyCategory::getByID($set->getAttributeSetKeyCategoryID()); $list = AttributeKey::getList($cat->getAttributeKeyCategoryHandle()); $unassigned = $cat->getUnassignedAttributeKeys(); if (count($list) > 0) { ?> <div class="clearfix"> <ul class="inputs-list"> <?php foreach ($list as $ak) { $disabled = ''; if (!in_array($ak, $unassigned) && !$ak->inAttributeSet($set)) { $disabled = array('disabled' => 'disabled'); } ?> <li>
public static function getUserAddedList() { return parent::getList('user', array('akIsAutoCreated' => 0)); }
<?php defined('C5_EXECUTE') or die("Access Denied."); if (isset($_REQUEST['akID'])) { $at = AttributeKey::getInstanceByID($_REQUEST['akID']); } else { $at = AttributeType::getByID($_REQUEST['atID']); } if (is_object($at)) { $cnt = $at->getController(); if (isset($_REQUEST['args']) && is_array($_REQUEST['args'])) { $args = $_REQUEST['args']; } else { $args = array(); } if (method_exists($cnt, 'action_' . $_REQUEST['action'])) { //make sure the controller has the right method call_user_func_array(array($cnt, 'action_' . $_REQUEST['action']), $args); } }
public function reindex() { $attribs = UserAttributeKey::getAttributes($this->getUserID(), 'getSearchIndexValue'); $db = Loader::db(); $db->Execute('delete from UserSearchIndexAttributes where uID = ?', array($this->getUserID())); $searchableAttributes = array('uID' => $this->getUserID()); $rs = $db->Execute('select * from UserSearchIndexAttributes where uID = -1'); AttributeKey::reindex('UserSearchIndexAttributes', $searchableAttributes, $attribs, $rs); }
/** * Duplicates an attribute key */ public function duplicate($args = array()) { $db = Loader::db(); $r1 = $db->GetRow('select * from AttributeKeys where akID = ?', array($this->akID)); unset($r1['akID']); $r2 = $db->insert('AttributeKeys', $r1); $newAKID = $db->LastInsertId(); $ak = new AttributeKey(); $ak->load($newAKID); // now we duplicate the specific category fields $this->getController()->duplicateKey($ak); return $ak; }
public function reindex($index = false) { if ($this->isAlias()) { return false; } $db = Loader::db(); Loader::model('attribute/categories/collection'); $attribs = CollectionAttributeKey::getAttributes($this->getCollectionID(), $this->getVersionID(), 'getSearchIndexValue'); $db->Execute('delete from CollectionSearchIndexAttributes where cID = ?', array($this->getCollectionID())); $searchableAttributes = array('cID' => $this->getCollectionID()); $rs = $db->Execute('select * from CollectionSearchIndexAttributes where cID = -1'); AttributeKey::reindex('CollectionSearchIndexAttributes', $searchableAttributes, $attribs, $rs); if ($index == false) { Loader::library('database_indexed_search'); $index = new IndexedSearch(); } $index->reindexPage($this); }
/** * Returns an array of package items (e.g. blocks, themes) */ public function getPackageItems() { $items = array(); Loader::model('single_page'); Loader::library('mail/importer'); Loader::model('job'); Loader::model('collection_types'); Loader::model('system/captcha/library'); Loader::model('system/antispam/library'); $items['attribute_categories'] = AttributeKeyCategory::getListByPackage($this); $items['attribute_keys'] = AttributeKey::getListByPackage($this); $items['attribute_sets'] = AttributeSet::getListByPackage($this); $items['page_types'] = CollectionType::getListByPackage($this); $items['mail_importers'] = MailImporter::getListByPackage($this); $items['configuration_values'] = Config::getListByPackage($this); $items['block_types'] = BlockTypeList::getByPackage($this); $items['page_themes'] = PageTheme::getListByPackage($this); $tp = new TaskPermissionList(); $items['task_permissions'] = $tp->populatePackagePermissions($this); $items['single_pages'] = SinglePage::getListByPackage($this); $items['attribute_types'] = AttributeType::getListByPackage($this); $items['captcha_libraries'] = SystemCaptchaLibrary::getListByPackage($this); $items['antispam_libraries'] = SystemAntispamLibrary::getListByPackage($this); $items['jobs'] = Job::getListByPackage($this); ksort($items); return $items; }
public function reindex($index = false) { if ($this->isAlias()) { return false; } $db = Loader::db(); Loader::model('attribute/categories/collection'); $attribs = CollectionAttributeKey::getAttributes($this->getCollectionID(), $this->getVersionID(), 'getSearchIndexValue'); $db->Execute('delete from CollectionSearchIndexAttributes where cID = ?', array($this->getCollectionID())); $searchableAttributes = array('cID' => $this->getCollectionID()); $rs = $db->Execute('select * from CollectionSearchIndexAttributes where cID = -1'); AttributeKey::reindex('CollectionSearchIndexAttributes', $searchableAttributes, $attribs, $rs); if ($index == false) { Loader::library('database_indexed_search'); $index = new IndexedSearch(); } $datetime = Loader::helper('date')->getSystemDateTime(); $db->Replace('PageSearchIndex', array( 'cID' => $this->getCollectionID(), 'cName' => $this->getCollectionName(), 'cDescription' => $this->getCollectionDescription(), 'cPath' => $this->getCollectionPath(), 'cDatePublic' => $this->getCollectionDatePublic(), 'content' => $index->getBodyContentFromPage($this), 'cDateLastIndexed' => $datetime ), array('cID'), true); }
public function reindex($index = false, $actuallyDoReindex = true) { if ($this->isAlias()) { return false; } if ($actuallyDoReindex || ENABLE_PROGRESSIVE_PAGE_REINDEX == false) { $db = Loader::db(); Loader::model('attribute/categories/collection'); $attribs = CollectionAttributeKey::getAttributes($this->getCollectionID(), $this->getVersionID(), 'getSearchIndexValue'); $db->Execute('delete from CollectionSearchIndexAttributes where cID = ?', array($this->getCollectionID())); $searchableAttributes = array('cID' => $this->getCollectionID()); $rs = $db->Execute('select * from CollectionSearchIndexAttributes where cID = -1'); AttributeKey::reindex('CollectionSearchIndexAttributes', $searchableAttributes, $attribs, $rs); if ($index == false) { Loader::library('database_indexed_search'); $index = new IndexedSearch(); } $index->reindexPage($this); $db->Replace('PageSearchIndex', array('cID' => $this->getCollectionID(), 'cRequiresReindex' => 0), array('cID'), false); $cache = PageCache::getLibrary(); $cache->purge($this); } else { $db = Loader::db(); Config::save('DO_PAGE_REINDEX_CHECK', true); $db->Replace('PageSearchIndex', array('cID' => $this->getCollectionID(), 'cRequiresReindex' => 1), array('cID'), false); } }
/** * Returns an array of package items (e.g. blocks, themes) */ public function getPackageItems() { $items = array(); Loader::model('single_page'); Loader::model('dashboard/homepage'); Loader::library('mail/importer'); Loader::model('job'); Loader::model('collection_types'); $items['attribute_categories'] = AttributeKeyCategory::getListByPackage($this); $items['attribute_keys'] = AttributeKey::getListByPackage($this); $items['attribute_sets'] = AttributeSet::getListByPackage($this); $items['page_types'] = CollectionType::getListByPackage($this); $items['mail_importers'] = MailImporter::getListByPackage($this); $items['dashboard_modules'] = DashboardHomepageView::getModules($this); $items['configuration_values'] = Config::getListByPackage($this); $items['block_types'] = BlockTypeList::getByPackage($this); $items['page_themes'] = PageTheme::getListByPackage($this); $tp = new TaskPermissionList(); $items['task_permissions'] = $tp->populatePackagePermissions($this); $items['single_pages'] = SinglePage::getListByPackage($this); $items['attribute_types'] = AttributeType::getListByPackage($this); $items['jobs'] = Job::getListByPackage($this); ksort($items); return $items; }