public function down(Schema $schema) { $pe = Type::getByHandle('page_owner'); $category = Category::getByHandle('page_type'); if (is_object($category) && is_object($pe)) { $category->deassociateAccessEntityType($pe); } }
public static function getForUser($user) { $entities = array(); $types = Type::getList(); foreach ($types as $t) { $entities = array_merge($entities, $t->getAccessEntitiesForUser($user)); } return $entities; }
public function import(\SimpleXMLElement $sx) { if (isset($sx->permissionkeys)) { foreach ($sx->permissionkeys->permissionkey as $pk) { if (is_object(Key::getByHandle((string) $pk['handle']))) { continue; } $pkc = Category::getByHandle((string) $pk['category']); $c1 = $pkc->getPermissionKeyClass(); $pkx = call_user_func(array($c1, 'import'), $pk); $assignments = array(); if (isset($pk->access)) { foreach ($pk->access->children() as $ch) { if ($ch->getName() == 'group') { /* * Legacy */ $g = Group::getByName($ch['name']); if (!is_object($g)) { $g = Group::add($g['name'], $g['description']); } $pae = GroupEntity::getOrCreate($g); $assignments[] = $pae; } if ($ch->getName() == 'entity') { $type = Type::getByHandle((string) $ch['type']); $class = $type->getAccessEntityTypeClass(); if (method_exists($class, 'configureFromImport')) { $pae = $class::configureFromImport($ch); $assignments[] = $pae; } } } } if (count($assignments)) { $pa = Access::create($pkx); foreach ($assignments as $pae) { $pa->addListItem($pae); } $pt = $pkx->getPermissionAssignmentObject(); $pt->assignPermissionAccess($pa); } } } }
public function setUp() { $this->tables = array_merge($this->tables, array('PermissionAccessList', 'PageTypeComposerFormLayoutSets', 'AttributeSetKeys', 'AttributeSets', 'AttributeKeyCategories', 'PermissionAccessEntityTypes', 'Packages', 'AttributeKeys', 'AttributeTypes', 'PageFeeds')); parent::setUp(); \Concrete\Core\Permission\Access\Entity\Type::add('page_owner', 'Page Owner'); \Concrete\Core\Permission\Category::add('page'); \Concrete\Core\Permission\Key\Key::add('page', 'view_page', 'View Page', '', 0, 0); PageTemplate::add('left_sidebar', 'Left Sidebar'); PageTemplate::add('right_sidebar', 'Right Sidebar'); PageType::add(array('handle' => 'alternate', 'name' => 'Alternate')); PageType::add(array('handle' => 'another', 'name' => 'Another')); foreach ($this->pageData as $data) { $c = call_user_func_array(array($this, 'createPage'), $data); $c->reindex(); } $this->list = new \Concrete\Core\Page\PageList(); $this->list->ignorePermissions(); }
public function import(\SimpleXMLElement $sx) { if (isset($sx->permissionaccessentitytypes)) { foreach ($sx->permissionaccessentitytypes->permissionaccessentitytype as $pt) { $type = Type::getByHandle((string) $pt['handle']); if (!is_object($type)) { $pkg = static::getPackageObject($pt['package']); $name = $pt['name']; if (!$name) { $name = \Core::make('helper/text')->unhandle($pt['handle']); } $type = Type::add($pt['handle'], $name, $pkg); } if (isset($pt->categories)) { foreach ($pt->categories->children() as $cat) { $catobj = Category::getByHandle((string) $cat['handle']); $catobj->associateAccessEntityType($type); } } } } }
protected function setUp() { $this->tables = array_merge($this->tables, array('Files', 'FileVersions', 'Users', 'PermissionAccessEntityTypes', 'FileAttributeValues', 'AttributeKeyCategories', 'AttributeSetKeys', 'Packages', 'AttributeSets', 'FileImageThumbnailTypes', 'AttributeTypes', 'ConfigStore', 'AttributeKeys', 'AttributeValues', 'FileSets', 'atNumber', 'FileVersionLog', 'FileSetFiles')); parent::setUp(); \Config::set('concrete.upload.extensions', '*.txt;*.jpg;*.jpeg;*.png'); Category::add('file'); \Concrete\Core\Permission\Access\Entity\Type::add('file_uploader', 'File Uploader'); $number = AttributeType::add('number', 'Number'); FileKey::add($number, array('akHandle' => 'width', 'akName' => 'Width')); FileKey::add($number, array('akHandle' => 'height', 'akName' => 'Height')); mkdir($this->getStorageDirectory()); $this->getStorageLocation(); $sample = dirname(__FILE__) . '/StorageLocation/fixtures/sample.txt'; $image = DIR_BASE . '/concrete/images/logo.png'; $fi = new Importer(); $files = array('sample1.txt' => $sample, 'sample2.txt' => $sample, 'sample4.txt' => $sample, 'sample5.txt' => $sample, 'awesome.txt' => $sample, 'testing.txt' => $sample, 'logo1.png' => $image, 'logo2.png' => $image, 'logo3.png' => $image, 'foobley.png' => $image, 'test.png' => $image); foreach ($files as $filename => $pointer) { $fi->import($pointer, $filename); } $this->list = new \Concrete\Core\File\FileList(); $this->list->ignorePermissions(); }
public function execute(Batch $batch) { $types = $batch->getObjectCollection('permission_access_entity_type'); if (!$types) { return; } foreach ($types->getTypes() as $type) { if (!$type->getPublisherValidator()->skipItem()) { $pkg = null; if ($type->getPackage()) { $pkg = \Package::getByHandle($type->getPackage()); } $type = Type::add($type->getHandle(), $type->getName(), $pkg); $categories = $type->getCategories(); foreach ($categories as $category) { $co = Category::getByHandle($category); if (is_object($co)) { $co->associateAccessEntityType($type); } } } } }
public function deassociateAccessEntityType(\Concrete\Core\Permission\Access\Entity\Type $pt) { $db = Loader::db(); $db->delete('PermissionAccessEntityTypeCategories', array('petID' => $pt->getAccessEntityTypeID(), 'pkCategoryID' => $this->getPermissionKeyCategoryID())); }
/** * Returns an array of package items (e.g. blocks, themes) */ public function getPackageItems() { $items = array(); $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'] = PageType::getListByPackage($this); $items['page_templates'] = PageTemplate::getListByPackage($this); $items['mail_importers'] = MailImporter::getListByPackage($this); $items['gathering_item_template_types'] = GatheringItemTemplateType::getListByPackage($this); $items['gathering_item_templates'] = GatheringItemTemplate::getListByPackage($this); $items['gathering_data_sources'] = GatheringDataSource::getListByPackage($this); $items['features'] = Feature::getListByPackage($this); $items['feature_categories'] = FeatureCategory::getListByPackage($this); $btl = new BlockTypeList(); $btl->filterByPackage($this); $blocktypes = $btl->get(); $items['block_types'] = $blocktypes; $items['block_type_sets'] = BlockTypeSet::getListByPackage($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['content_editor_snippets'] = SystemContentEditorSnippet::getListByPackage($this); $items['conversation_editors'] = ConversationEditor::getListByPackage($this); $items['conversation_rating_types'] = ConversationRatingType::getListByPackage($this); $items['page_type_publish_target_types'] = PageTypePublishTargetType::getListByPackage($this); $items['page_type_composer_control_types'] = PageTypeComposerControlType::getListByPackage($this); $items['antispam_libraries'] = SystemAntispamLibrary::getListByPackage($this); $items['community_point_actions'] = UserPointAction::getListByPackage($this); $items['jobs'] = Job::getListByPackage($this); $items['workflow_types'] = WorkflowType::getListByPackage($this); ksort($items); return $items; }
public function up(Schema $schema) { \Concrete\Core\Database\Schema\Schema::refreshCoreXMLSchema(array('ConversationPermissionAddMessageAccessList', 'ConversationSubscriptions', 'Conversations')); // Subscribe admin to conversations by default, if we have no subscriptions $users = \Conversation::getDefaultSubscribedUsers(); if (count($users) == 0) { $admin = \UserInfo::getByID(USER_SUPER_ID); if (is_object($admin)) { $users = array($admin); \Conversation::setDefaultSubscribedUsers($users); } } $db = \Database::get(); $db->Execute('DROP TABLE IF EXISTS PageStatistics'); $pp = $schema->getTable('PagePaths'); if (!$pp->hasColumn('ppGeneratedFromURLSlugs')) { $db->Execute('alter table PagePaths add column ppGeneratedFromURLSlugs tinyint(1) unsigned not null default 0'); // we have to do this directly because the page path calls below will die otherwise. } $bt = BlockType::getByHandle('page_list'); if (is_object($bt)) { $bt->refresh(); } $bt = BlockType::getByHandle('page_title'); if (is_object($bt)) { $bt->refresh(); } $bt = BlockType::getByHandle('form'); if (is_object($bt)) { $bt->refresh(); } $c = \Page::getByPath('/dashboard/system/seo/urls'); if (is_object($c) && !$c->isError()) { $c->update(array('cName' => 'URLs and Redirection')); } $sp = \Page::getByPath('/dashboard/system/environment/entities'); if (!is_object($sp) || $sp->isError()) { $sp = \SinglePage::add('/dashboard/system/environment/entities'); $sp->update(array('cName' => 'Database Entities')); $sp->setAttribute('meta_keywords', 'database, entities, doctrine, orm'); } $pkx = Category::getByHandle('multilingual_section'); if (!is_object($pkx)) { $pkx = Category::add('multilingual_section'); } $pkx->associateAccessEntityType(Type::getByHandle('group')); $pkx->associateAccessEntityType(Type::getByHandle('user')); $pkx->associateAccessEntityType(Type::getByHandle('group_combination')); $db->Execute("alter table QueueMessages modify column body longtext not null"); $ms = $schema->getTable('MultilingualSections'); if (!$ms->hasColumn('msNumPlurals')) { $ms->addColumn('msNumPlurals', 'integer', array('notnull' => true, 'unsigned' => true, 'default' => 2)); $this->updateSectionPlurals = true; } if (!$ms->hasColumn('msPluralRule')) { $ms->addColumn('msPluralRule', 'string', array('notnull' => true, 'length' => 400, 'default' => '(n != 1)')); $this->updateSectionPlurals = true; } if (!$ms->hasColumn('msPluralCases')) { $ms->addColumn('msPluralCases', 'string', array('notnull' => true, 'length' => 1000, 'default' => "one@1\nother@0, 2~16, 100, 1000, 10000, 100000, 1000000, …")); $this->updateSectionPlurals = true; } $mt = $schema->getTable('MultilingualTranslations'); if (!$mt->hasColumn('msgidPlural')) { $mt->addColumn('msgidPlural', 'text', array('notnull' => false)); $this->updateMultilingualTranslations = true; } if (!$mt->hasColumn('msgstrPlurals')) { $mt->addColumn('msgstrPlurals', 'text', array('notnull' => false)); $this->updateMultilingualTranslations = true; } $cms = $schema->getTable('ConversationMessages'); if (!$cms->hasColumn('cnvMessageAuthorName')) { $cms->addColumn('cnvMessageAuthorName', 'string', array('notnull' => false, 'length' => 255)); } if (!$cms->hasColumn('cnvMessageAuthorEmail')) { $cms->addColumn('cnvMessageAuthorEmail', 'string', array('notnull' => false, 'length' => 255)); } if (!$cms->hasColumn('cnvMessageAuthorWebsite')) { $cms->addColumn('cnvMessageAuthorWebsite', 'string', array('notnull' => false, 'length' => 255)); } $this->updatePermissionDurationObjects(); $key = Key::getByHandle('add_conversation_message'); if (is_object($key) && !$key->permissionKeyHasCustomClass()) { $key->setPermissionKeyHasCustomClass(true); } $this->installMaintenanceModePermission(); }
public function run() { $this->x = new SimpleXMLElement("<concrete5-cif></concrete5-cif>"); $this->x->addAttribute('version', '1.0'); // First, attribute categories AttributeKeyCategory::exportList($this->x); // Features Feature::exportList($this->x); FeatureCategory::exportList($this->x); ConversationEditor::exportList($this->x); ConversationRatingType::exportList($this->x); // composer PageTypePublishTargetType::exportList($this->x); PageTypeComposerControlType::exportList($this->x); PageType::exportList($this->x); // attribute types AttributeType::exportList($this->x); // then block types BlockTypeList::exportList($this->x); // now block type sets (including user) BlockTypeSet::exportList($this->x); // gathering GatheringDataSource::exportList($this->x); GatheringItemTemplate::exportList($this->x); // now attribute keys (including user) AttributeKey::exportList($this->x); // now attribute keys (including user) AttributeSet::exportList($this->x); PageTemplate::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 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 stacks/global areas StackList::export($this->x); // now content pages $pages = $this->x->addChild("pages"); $db = Loader::db(); $r = $db->Execute('select Pages.cID from Pages where cIsTemplate = 0 and cFilename is null or cFilename = "" order by cID asc'); while ($row = $r->FetchRow()) { $pc = Page::getByID($row['cID'], 'RECENT'); if ($pc->getPageTypeHandle() == STACKS_PAGE_TYPE) { continue; } $pc->export($pages); } SystemCaptchaLibrary::exportList($this->x); \Concrete\Core\Sharing\SocialNetwork\Link::exportList($this->x); \Concrete\Core\Page\Feed::exportList($this->x); \Concrete\Core\File\Image\Thumbnail\Type\Type::exportList($this->x); Config::exportList($this->x); Tree::exportList($this->x); }
protected function importPermissionAccessEntityTypes(\SimpleXMLElement $sx) { if (isset($sx->permissionaccessentitytypes)) { foreach ($sx->permissionaccessentitytypes->permissionaccessentitytype as $pt) { $pkg = static::getPackageObject($pt['package']); $name = $pt['name']; if (!$name) { $name = Loader::helper('text')->unhandle($pt['handle']); } $type = PermissionAccessEntityType::add($pt['handle'], $name, $pkg); if (isset($pt->categories)) { foreach ($pt->categories->children() as $cat) { $catobj = PermissionKeyCategory::getByHandle((string) $cat['handle']); $catobj->associateAccessEntityType($type); } } } } }
public function associateAccessEntityType(\Concrete\Core\Permission\Access\Entity\Type $pt) { $db = Loader::db(); $r = $db->GetOne('select petID from PermissionAccessEntityTypeCategories where petID = ? and pkCategoryID = ?', array($pt->getAccessEntityTypeID(), $this->pkCategoryID)); if (!$r) { $db->Execute('insert into PermissionAccessEntityTypeCategories (petID, pkCategoryID) values (?, ?)', array($pt->getAccessEntityTypeID(), $this->pkCategoryID)); } }
<?php if (!is_object($pae)) { ?> <div class="btn-group"> <a class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#"> <i class="icon-plus-sign"></i> <?php echo t('Select'); ?> <span class="caret"></span> </a> <ul class="dropdown-menu"> <?php $category = PermissionKeyCategory::getByHandle($_REQUEST['pkCategoryHandle']); $entitytypes = PermissionAccessEntityType::getList($category); foreach ($entitytypes as $type) { ?> <li><?php echo $type->getAccessEntityTypeLinkHTML(); ?> </li> <?php } ?> </ul> </div> <br/><br/> <?php foreach ($entitytypes as $type) {
public function getPackageItems(Package $package) { return Type::getListByPackage($package); }
<?php defined('C5_EXECUTE') or die("Access Denied."); use Concrete\Core\Permission\Access\Entity\Type as PermissionAccessEntityType; $type = PermissionAccessEntityType::getByHandle('group_set'); $url = $type->getAccessEntityTypeToolsURL(); $tp = new TaskPermission(); if (!$tp->canAccessGroupSearch()) { echo t("You have no access to groups."); } else { $gl = new GroupSetList(); ?> <div id="ccm-list-wrapper"> <?php if ($gl->getTotal() > 0) { foreach ($gl->get() as $gs) { ?> <div class="ccm-group"> <div style="background-image: url(<?php echo ASSETS_URL_IMAGES; ?> /icons/group.png)" class="ccm-group-inner-indiv"> <a class="ccm-group-inner-atag" id="g<?php echo $g['gID']; ?> " href="javascript:void(0)" onclick="ccm_selectGroupSet(<?php echo $gs->getGroupSetID(); ?> )"><?php
<?php defined('C5_EXECUTE') or die("Access Denied."); $tp = new TaskPermission(); use Concrete\Core\Permission\Access\Entity\Type as PermissionAccessEntityType; $dt = Loader::helper('form/date_time'); if (!$tp->canAccessGroupSearch()) { die(t("You do not have group search permissions.")); } $type = PermissionAccessEntityType::getByHandle('group_combination'); $url = $type->getAccessEntityTypeToolsURL(); ?> <div class="ccm-ui"> <form method="post" action="<?php echo $url; ?> " id="ccm-permission-access-entity-combination-groups-form"> <p><?php echo t('Only users who are members of ALL selected groups will be eligible for this permission.'); ?> </p> <table id="ccm-permissions-access-entity-combination-groups" class="table table-bordered"> <tr> <th><div style="width: 16px"></div></th> <th width="100%"><?php echo t("Name"); ?>
public function up(Schema $schema) { $ft = FlagType::getByhandle('spam'); if (!is_object($ft)) { FlagType::add('spam'); } $bt = BlockType::getByHandle('image_slider'); $bt->refresh(); $types = array(Type::getByHandle('group'), Type::getByHandle('user'), Type::getByHandle('group_set'), Type::getByHandle('group_combination')); $categories = array(Category::getByHandle('conversation'), Category::getByHandle('conversation_message')); foreach ($categories as $category) { foreach ($types as $pe) { if (is_object($category) && is_object($pe)) { $category->associateAccessEntityType($pe); } } } try { $gat = AuthenticationType::getByHandle('google'); } catch (Exception $e) { $gat = AuthenticationType::add('google', 'Google'); if (is_object($gat)) { $gat->disable(); } } // fix register page permissions $g1 = \Group::getByID(GUEST_GROUP_ID); $register = \Page::getByPath('/register', "RECENT"); $register->assignPermissions($g1, array('view_page')); // add new permissions, set it to the same value as edit page permissions on all pages. $epk = PermissionKey::getByHandle('edit_page_permissions'); $msk = PermissionKey::getByHandle('edit_page_multilingual_settings'); $ptk = PermissionKey::getByHandle('edit_page_page_type'); if (!is_object($msk)) { $msk = PermissionKey::add('page', 'edit_page_multilingual_settings', 'Edit Multilingual Settings', 'Controls whether a user can see the multilingual settings menu, re-map a page or set a page as ignored in multilingual settings.', false, false); } if (!is_object($ptk)) { $ptk = PermissionKey::add('page', 'edit_page_page_type', 'Edit Page Type', 'Change the type of an existing page.', false, false); } $db = \Database::get(); $r = $db->Execute('select cID from Pages where cInheritPermissionsFrom = "OVERRIDE" order by cID asc'); while ($row = $r->FetchRow()) { $c = Page::getByID($row['cID']); if (is_object($c) && !$c->isError()) { $epk->setPermissionObject($c); $msk->setPermissionObject($c); $ptk->setPermissionObject($c); $rpa = $epk->getPermissionAccessObject(); if (is_object($rpa)) { $pt = $msk->getPermissionAssignmentObject(); if (is_object($pt)) { $pt->clearPermissionAssignment(); $pt->assignPermissionAccess($rpa); } $pt = $ptk->getPermissionAssignmentObject(); if (is_object($pt)) { $pt->clearPermissionAssignment(); $pt->assignPermissionAccess($rpa); } } } } // add new page type permissions $epk = PermissionKey::getByHandle('edit_page_type_permissions'); $msk = PermissionKey::getByHandle('edit_page_type'); $dsk = PermissionKey::getByHandle('delete_page_type'); if (!is_object($msk)) { $msk = PermissionKey::add('page_type', 'edit_page_type', 'Edit Page Type', '', false, false); } if (!is_object($dsk)) { $dsk = PermissionKey::add('page_type', 'delete_page_type', 'Delete Page Type', '', false, false); } $list = \Concrete\Core\Page\Type\Type::getList(); foreach ($list as $pagetype) { $epk->setPermissionObject($pagetype); $msk->setPermissionObject($pagetype); $dsk->setPermissionObject($pagetype); $rpa = $epk->getPermissionAccessObject(); if (is_object($rpa)) { $pt = $msk->getPermissionAssignmentObject(); if (is_object($pt)) { $pt->clearPermissionAssignment(); $pt->assignPermissionAccess($rpa); } $pt = $dsk->getPermissionAssignmentObject(); if (is_object($pt)) { $pt->clearPermissionAssignment(); $pt->assignPermissionAccess($rpa); } } } // add new multilingual tables. $sm = $db->getSchemaManager(); $schemaTables = $sm->listTableNames(); if (!in_array('MultilingualPageRelations', $schemaTables)) { $mpr = $schema->createTable('MultilingualPageRelations'); $mpr->addColumn('mpRelationID', 'integer', array('notnull' => true, 'unsigned' => true, 'default' => 0)); $mpr->addColumn('cID', 'integer', array('notnull' => true, 'unsigned' => true, 'default' => 0)); $mpr->addColumn('mpLanguage', 'string', array('notnull' => true, 'default' => '')); $mpr->addColumn('mpLocale', 'string', array('notnull' => true)); $mpr->setPrimaryKey(array('mpRelationID', 'cID', 'mpLocale')); } if (!in_array('MultilingualSections', $schemaTables)) { $mus = $schema->createTable('MultilingualSections'); $mus->addColumn('cID', 'integer', array('notnull' => true, 'unsigned' => true, 'default' => 0)); $mus->addColumn('msLanguage', 'string', array('notnull' => true, 'default' => '')); $mus->addColumn('msCountry', 'string', array('notnull' => true, 'default' => '')); $mus->setPrimaryKey(array('cID')); } if (!in_array('MultilingualTranslations', $schemaTables)) { $mts = $schema->createTable('MultilingualTranslations'); $mts->addColumn('mtID', 'integer', array('autoincrement' => true, 'unsigned' => true)); $mts->addColumn('mtSectionID', 'integer', array('unsigned' => true, 'notnull' => true, 'default' => 0)); $mts->addColumn('msgid', 'text', array('notnull' => false)); $mts->addColumn('msgstr', 'text', array('notnull' => false)); $mts->addColumn('context', 'text', array('notnull' => false)); $mts->addColumn('comments', 'text', array('notnull' => false)); $mts->addColumn('reference', 'text', array('notnull' => false)); $mts->addColumn('flags', 'text', array('notnull' => false)); $mts->addColumn('updated', 'datetime', array('notnull' => false)); $mts->setPrimaryKey(array('mtID')); } // block type $bt = BlockType::getByHandle('switch_language'); if (!is_object($bt)) { $bt = BlockType::installBlockType('switch_language'); } // single pages $sp = Page::getByPath('/dashboard/system/multilingual'); if (!is_object($sp) || $sp->isError()) { $sp = SinglePage::add('/dashboard/system/multilingual'); $sp->update(array('cName' => 'Multilingual')); $sp->setAttribute('meta_keywords', 'multilingual, localization, internationalization, i18n'); } $sp = Page::getByPath('/dashboard/system/multilingual/setup'); if (!is_object($sp) || $sp->isError()) { $sp = SinglePage::add('/dashboard/system/multilingual/setup'); $sp->update(array('cName' => 'Multilingual Setup')); } $sp = Page::getByPath('/dashboard/system/multilingual/page_report'); if (!is_object($sp) || $sp->isError()) { $sp = SinglePage::add('/dashboard/system/multilingual/page_report'); $sp->update(array('cName' => 'Page Report')); } $sp = Page::getByPath('/dashboard/system/multilingual/translate_interface'); if (!is_object($sp) || $sp->isError()) { $sp = SinglePage::add('/dashboard/system/multilingual/translate_interface'); $sp->update(array('cName' => 'Translate Interface')); } $sp = Page::getByPath('/dashboard/pages/types/attributes'); if (!is_object($sp) || $sp->isError()) { $sp = SinglePage::add('/dashboard/pages/types/attributes'); $sp->update(array('cName' => 'Page Type Attributes')); } }
protected function getClass($entity) { $type = \Concrete\Core\Permission\Access\Entity\Type::getByHandle($entity->getType()); $class = $type->getAccessEntityTypeClass(); return $class; }
public function skipItem() { $type = Type::getByHandle($this->object->getHandle()); return is_object($type); }