当前位置: 首页>>代码示例>>PHP>>正文


PHP AttributeType类代码示例

本文整理汇总了PHP中AttributeType的典型用法代码示例。如果您正苦于以下问题:PHP AttributeType类的具体用法?PHP AttributeType怎么用?PHP AttributeType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AttributeType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add

 public function add($atHandle, $atName, $pkg = null)
 {
     $type = new AttributeType();
     $type->setAttributeTypeName($atName);
     $type->setAttributeTypeHandle($atHandle);
     if ($pkg) {
         $type->setPackage($pkg);
     }
     $this->entityManager->persist($type);
     $this->entityManager->flush();
     return $type;
 }
开发者ID:seebaermichi,项目名称:concrete5,代码行数:12,代码来源:SetFactory.php

示例2: installOrUpgrade

 private function installOrUpgrade($pkg, $fromVersion)
 {
     $at = AttributeType::getByHandle('handle_https');
     if (!is_object($at)) {
         $at = AttributeType::add('handle_https', tc('AttributeTypeName', 'HTTPS handling'), $pkg);
     }
     $akc = AttributeKeyCategory::getByHandle('collection');
     if (is_object($akc)) {
         if (!$akc->hasAttributeKeyTypeAssociated($at)) {
             $akc->associateAttributeKeyType($at);
         }
     }
     if (empty($fromVersion)) {
         $ak = CollectionAttributeKey::getByHandle('handle_https');
         if (!is_object($ak)) {
             $hhh = Loader::helper('https_handling', 'handle_https');
             /* @var $hhh HttpsHandlingHelper */
             $httpDomain = defined('BASE_URL') ? BASE_URL : Config::get('BASE_URL');
             if (!$httpDomain) {
                 $httpDomain = 'http://' . $hhh->getRequestDomain();
             }
             $httpsDomain = defined('BASE_URL_SSL') ? BASE_URL_SSL : Config::get('BASE_URL_SSL');
             if (!$httpsDomain) {
                 $httpsDomain = 'https://' . $hhh->getRequestDomain();
             }
             $ak = CollectionAttributeKey::add($at, array('akHandle' => 'handle_https', 'akName' => tc('AttributeKeyName', 'Page HTTP/HTTPS'), 'akIsSearchable' => 1, 'akIsSearchableIndexed' => 1, 'akIsAutoCreated' => 1, 'akIsEditable' => 1, 'akIsInternal' => 0, 'akEnabled' => 0, 'akDefaultRequirement' => HttpsHandlingHelper::SSLHANDLING_DOESNOT_MATTER, 'akCustomDomains' => 0, 'akHTTPDomain' => $httpDomain, 'akHTTPSDomain' => $httpsDomain), $pkg);
         }
     }
 }
开发者ID:mlocati,项目名称:concrete5-handle_https,代码行数:29,代码来源:controller.php

示例3: CoreAutoload

function CoreAutoload($class)
{
    $txt = Loader::helper('text');
    if ($class == 'DashboardBaseController') {
        Loader::controller('/dashboard/base');
    }
    if (strpos($class, 'BlockController') > 0) {
        $class = substr($class, 0, strpos($class, 'BlockController'));
        $handle = $txt->uncamelcase($class);
        Loader::block($handle);
    } else {
        if (strpos($class, 'Helper') > 0) {
            $class = substr($class, 0, strpos($class, 'Helper'));
            $handle = $txt->uncamelcase($class);
            $handle = preg_replace('/^site_/', '', $handle);
            Loader::helper($handle);
        } else {
            if (strpos($class, 'AttributeType') > 0) {
                $class = substr($class, 0, strpos($class, 'AttributeType'));
                $handle = $txt->uncamelcase($class);
                $at = AttributeType::getByHandle($handle);
            }
        }
    }
}
开发者ID:nbourguig,项目名称:concrete5,代码行数:25,代码来源:autoload.php

示例4: getByHandle

	public static function getByHandle($akHandle) {
		$db = Loader::db();
		$q = "SELECT ak.akID 
			FROM AttributeKeys ak
			INNER JOIN AttributeKeyCategories akc ON ak.akCategoryID = akc.akCategoryID 
			WHERE ak.akHandle = ?
			AND akc.akCategoryHandle = 'file'";
		$akID = $db->GetOne($q, array($akHandle));
		if ($akID > 0) {
			$ak = FileAttributeKey::getByID($akID);
			return $ak;
		} else {
			 // else we check to see if it's listed in the initial registry
			 $ia = FileTypeList::getImporterAttribute($akHandle);
			 if (is_object($ia)) {
			 	// we create this attribute and return it.
			 	$at = AttributeType::getByHandle($ia->akType);
				$args = array(
					'akHandle' => $akHandle,
					'akName' => $ia->akName,
					'akIsSearchable' => 1,
					'akIsAutoCreated' => 1,
					'akIsEditable' => $ia->akIsEditable
				);
			 	return FileAttributeKey::add($at, $args);
			 }
		}	
	}
开发者ID:nbourguig,项目名称:concrete5,代码行数:28,代码来源:file.php

示例5: parseManual

 /**
  * {@inheritdoc}
  *
  * @see \C5TL\Parser\DynamicItem::parseManual()
  */
 public function parseManual(\Gettext\Translations $translations, $concrete5version)
 {
     if (class_exists('\\AttributeType', true)) {
         foreach (\AttributeType::getList() as $at) {
             $this->addTranslation($translations, $at->getAttributeTypeName(), 'AttributeTypeName');
         }
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:13,代码来源:AttributeType.php

示例6: install

 public function install()
 {
     $pkg = parent::install();
     $pkgh = Package::getByHandle('page_selector_attribute');
     Loader::model('attribute/categories/collection');
     $col = AttributeKeyCategory::getByHandle('collection');
     $pageselector = AttributeType::add('page_selector', t('Page Selector'), $pkgh);
     $col->associateAttributeKeyType(AttributeType::getByHandle('page_selector'));
 }
开发者ID:WillemAnchor,项目名称:page_selector_attribute,代码行数:9,代码来源:controller.php

示例7: import

 public static function import(SimpleXMLElement $ak)
 {
     $type = AttributeType::getByHandle($ak['type']);
     $pkg = false;
     if ($ak['package']) {
         $pkg = Package::getByHandle($ak['package']);
     }
     $akn = UserAttributeKey::add($type, array('akHandle' => $ak['handle'], 'akName' => $ak['name'], 'akIsSearchableIndexed' => $ak['indexed'], 'akIsSearchable' => $ak['searchable'], 'uakProfileDisplay' => $ak['profile-displayed'], 'uakProfileEdit' => $ak['profile-editable'], 'uakProfileEditRequired' => $ak['profile-required'], 'uakRegisterEdit' => $ak['register-editable'], 'uakRegisterEditRequired' => $ak['register-required'], 'uakMemberListDisplay' => $ak['member-list-displayed']), $pkg);
     $akn->getController()->importKey($ak);
 }
开发者ID:ronlobo,项目名称:concrete5-de,代码行数:10,代码来源:user.php

示例8: run

 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);
 }
开发者ID:Mihail9575,项目名称:concrete5,代码行数:52,代码来源:exporter.php

示例9: save_attribute_type_associations

 public function save_attribute_type_associations()
 {
     $list = AttributeKeyCategory::getList();
     foreach ($list as $cat) {
         $cat->clearAttributeKeyCategoryTypes();
         if (is_array($this->post($cat->getAttributeKeyCategoryHandle()))) {
             foreach ($this->post($cat->getAttributeKeyCategoryHandle()) as $id) {
                 $type = AttributeType::getByID($id);
                 $cat->associateAttributeKeyType($type);
             }
         }
     }
     $this->redirect('dashboard/system/attributes/types', 'saved', 'associations_updated');
 }
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:14,代码来源:types.php

示例10: __autoload

function __autoload($class) {
	$txt = Loader::helper('text');
	if (strpos($class, 'BlockController') > 0) {
		$class = substr($class, 0, strpos($class, 'BlockController'));
		$handle = $txt->uncamelcase($class);
		Loader::block($handle);
	} else if (strpos($class, 'Helper') > 0) {
		$class = substr($class, 0, strpos($class, 'Helper'));
		$handle = $txt->uncamelcase($class);
		$handle = preg_replace('/^site_/', '', $handle);
		Loader::helper($handle);
	} else if (strpos($class, 'AttributeType') > 0) {
		$class = substr($class, 0, strpos($class, 'AttributeType'));
		$handle = $txt->uncamelcase($class);
		$at = AttributeType::getByHandle($handle);
	}
}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:17,代码来源:autoload.php

示例11: getByHandle

 public static function getByHandle($akHandle)
 {
     $db = Loader::db();
     $akID = $db->GetOne('select akID from AttributeKeys where akHandle = ?', array($akHandle));
     if ($akID > 0) {
         $ak = FileAttributeKey::getByID($akID);
         return $ak;
     } else {
         // else we check to see if it's listed in the initial registry
         $ia = FileTypeList::getImporterAttribute($akHandle);
         if (is_object($ia)) {
             // we create this attribute and return it.
             $at = AttributeType::getByHandle($ia->akType);
             $args = array('akHandle' => $akHandle, 'akName' => $ia->akName, 'akIsSearchable' => 1, 'akIsAutoCreated' => 1, 'akIsEditable' => $ia->akIsEditable);
             return FileAttributeKey::add($at, $args);
         }
     }
 }
开发者ID:homer6,项目名称:concrete5-mirror,代码行数:18,代码来源:file.php

示例12: exportAll

 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);
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:44,代码来源:exporter.php

示例13: getSelectOptions

 /**
  * Looks up the list of options from the DB
  * This is the only place where themes are 'categorized', which is purely for presentation in the walk create form
  *
  * @param string $type Which type of tag to return (e.g. theme, accessible)
  * @return array
  */
 public static function getSelectOptions($type = 'all')
 {
     $options = array();
     $satc = new SelectAttributeTypeController(AttributeType::getByHandle('select'));
     if ($type === 'all' || $type === 'theme') {
         $satc->setAttributeKey(CollectionAttributeKey::getByHandle('theme'));
         $themeAK = CollectionAttributeKey::getByHandle('theme');
         foreach ($satc->getOptions() as $v) {
             $category = $this->getCategory($v->value);
             $options['theme'][$category][] = ['handle' => $v->value, 'name' => self::getName($v->value)];
         }
     }
     if ($type === 'all' || $type === 'accessibile') {
         $satc->setAttributeKey(CollectionAttributeKey::getByHandle('accessible'));
         foreach ($satc->getOptions() as $v) {
             $options['accessible'][] = ['handle' => $v->value, 'name' => self::getName($v->value)];
         }
     }
     return $options;
 }
开发者ID:r-bansal,项目名称:janeswalk-web-1,代码行数:27,代码来源:theme.php

示例14: run

 public function run()
 {
     $db = Loader::db();
     Cache::disableLocalCache();
     Loader::model('attribute/categories/collection');
     $cak = CollectionAttributeKey::getByHandle('exclude_page_list');
     if (!is_object($cak)) {
         $boolt = AttributeType::getByHandle('boolean');
         $cab4b = CollectionAttributeKey::add($boolt, array('akHandle' => 'exclude_page_list', 'akName' => t('Exclude From Page List'), 'akIsSearchable' => true));
         Loader::model('page_list');
         $pl = new PageList();
         $pl->filterByExcludeNav(1);
         $list = $pl->get();
         foreach ($list as $c) {
             $c->setAttribute('exclude_page_list', 1);
             $c->reindex();
         }
     }
     Cache::enableLocalCache();
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:20,代码来源:version_533.php

示例15: installPageLinkAttribute

 private function installPageLinkAttribute(&$pkg)
 {
     $at = AttributeType::getByHandle('page_selector');
     if ($at && intval($at->getAttributeTypeID())) {
         //Associate with "file" category (if not done alrady)
         Loader::model('attribute/categories/collection');
         $akc = AttributeKeyCategory::getByHandle('file');
         $sql = 'SELECT COUNT(*) FROM AttributeTypeCategories WHERE atID = ? AND akCategoryID = ?';
         $vals = array($at->getAttributeTypeID(), $akc->akCategoryID);
         $existsInCategory = Loader::db()->GetOne($sql, $vals);
         if (!$existsInCategory) {
             $akc->associateAttributeKeyType($at);
         }
         //Install the link-to-page attribute (if not done already)
         Loader::model('file_attributes');
         $akHandle = 'gallery_link_to_cid';
         $akGalleryLinkToCID = FileAttributeKey::getByHandle($akHandle);
         if (!is_object($akGalleryLinkToCID) || !intval($akGalleryLinkToCID->getAttributeKeyID())) {
             $akGalleryLinkToCID = FileAttributeKey::add($at, array('akHandle' => $akHandle, 'akName' => t('Gallery Link To Page')), $pkg);
         }
     }
 }
开发者ID:robchenski,项目名称:ids,代码行数:22,代码来源:controller.php


注:本文中的AttributeType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。