• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP AttributeType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: install

 public function install()
 {
     $pkg = parent::install();
     Loader::model('single_page');
     $single_page = SinglePage::add('/dashboard/wordpress_import', $pkg);
     $single_page->update(array('cName' => t('WordPress Import'), 'cDescription' => t('Import WordPress Sites')));
     $import_stuff = SinglePage::add('/dashboard/wordpress_import/import', $pkg);
     $import_stuff->update(array('cName' => t('Import')));
     $import_stuff = SinglePage::add('/dashboard/wordpress_import/file', $pkg);
     $import_stuff->update(array('cName' => t('File')));
     $select = AttributeType::getByHandle('select');
     $wpCategory = CollectionAttributeKey::getByHandle('wordpress_category');
     if (!$wpCategory instanceof CollectionAttributeKey) {
         $wpCategory = CollectionAttributeKey::add($select, array('akSelectAllowMultipleValues' => 1, 'akSelectOptionDisplayOrder' => 'popularity_desc', 'akSelectAllowOtherValues' => 1, 'akHandle' => 'wordpress_category', 'akName' => t('Wordpress Category')), $pkg);
     }
     $tags = CollectionAttributeKey::getByHandle('tags');
     if (!$tags instanceof CollectionAttributeKey) {
         $tags = CollectionAttributeKey::add($select, array('akSelectAllowMultipleValues' => 1, 'akSelectOptionDisplayOrder' => 'popularity_desc', 'akSelectAllowOtherValues' => 1, 'akHandle' => 'tagsy', 'akName' => t('Tags')), $pkg);
     }
     $co = new Config();
     $co->setPackageObject($pkg);
     $co->save("WORDPRESS_IMPORT_FID", 0);
 }
开发者ID:herent,项目名称:wordpress_site_importer,代码行数:23,代码来源:controller.php


示例17: autoload

 /** 
  * @private
  */
 public static function autoload($class)
 {
     $classes = self::$autoloadClasses;
     $cl = $classes[$class];
     if ($cl) {
         call_user_func_array(array(__CLASS__, $cl[0]), array($cl[1], $cl[2]));
     } else {
         /* lets handle some things slightly more dynamically */
         $txt = self::helper('text');
         if (strpos($class, 'BlockController') > 0) {
             $class = substr($class, 0, strpos($class, 'BlockController'));
             $handle = $txt->uncamelcase($class);
             self::block($handle);
         } else {
             if (strpos($class, 'AttributeType') > 0) {
                 $class = substr($class, 0, strpos($class, 'AttributeType'));
                 $handle = $txt->uncamelcase($class);
                 $at = AttributeType::getByHandle($handle);
             } else {
                 if (strpos($class, 'Helper') > 0) {
                     $class = substr($class, 0, strpos($class, 'Helper'));
                     $handle = $txt->uncamelcase($class);
                     $handle = preg_replace('/^site_/', '', $handle);
                     self::helper($handle);
                 }
             }
         }
     }
 }
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:32,代码来源:loader.php


示例18: add

 public function add()
 {
     $this->select_type();
     $type = $this->get('type');
     $cnt = $type->getController();
     $e = $cnt->validateKey($this->post());
     if ($e->has()) {
         $this->set('error', $e);
     } else {
         $type = AttributeType::getByID($this->post('atID'));
         $ak = UserAttributeKey::add($type, $this->post());
         $this->redirect('/dashboard/users/attributes/', 'attribute_created');
     }
 }
开发者ID:nveid,项目名称:concrete5,代码行数:14,代码来源:attributes.php


示例19: defined

<? defined('C5_EXECUTE') or die("Access Denied.");

$types = AttributeType::getList();
$categories = AttributeKeyCategory::getList();
$txt = Loader::helper('text');
$form = Loader::helper('form');
$interface = Loader::helper('concrete/interface');

echo Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Attribute Type Associations'), false, 'span12 offset2');?>
<form method="post" class="" id="attribute_type_associations_form" action="<?=$this->action('save_attribute_type_associations')?>">
	<table border="0" cellspacing="1" cellpadding="0" border="0" class="zebra-striped">
		<tr>
			<th><?=t('Name')?></th>
			<? foreach($categories as $cat) { ?>
				<th><?=$txt->unhandle($cat->getAttributeKeyCategoryHandle())?></th>
			<? } ?>
		</tr>
		<?php foreach($types as $at) { ?>

			<tr>
				<td><?=$at->getAttributeTypeName()?></td>
				<? foreach($categories as $cat) { ?>
					<td style="width: 1px; text-align: center"><?=$form->checkbox($cat->getAttributeKeyCategoryHandle() . '[]', $at->getAttributeTypeID(), $at->isAssociatedWithCategory($cat))?></td>
				<? } ?>
			</tr>

		<? } ?>

	</table>
	<div class="well clearfix">
	<?
开发者ID:nbourguig,项目名称:concrete5,代码行数:31,代码来源:types.php


示例20: add

	public static function add($atHandle, $atName, $pkg = false) {
		$pkgID = 0;
		if (is_object($pkg)) {
			$pkgID = $pkg->getPackageID();
		}
		$db = Loader::db();
		$db->Execute('insert into AttributeTypes (atHandle, atName, pkgID) values (?, ?, ?)', array($atHandle, $atName, $pkgID));
		$id = $db->Insert_ID();
		$est = AttributeType::getByID($id);
		
		$path = $est->getAttributeTypeFilePath(FILENAME_ATTRIBUTE_DB);
		if ($path) {
			Package::installDB($path);
		}
		return $est;
	}
开发者ID:nveid,项目名称:concrete5,代码行数:16,代码来源:type.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP AttributeValue类代码示例发布时间:2022-05-23
下一篇:
PHP AttributeKeyCategory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap