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


PHP BlockType::getByHandle方法代码示例

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


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

示例1: run

 public function run()
 {
     $bt = BlockType::getByHandle('guestbook');
     if (is_object($bt)) {
         $bt->refresh();
     }
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:7,代码来源:version_5602.php

示例2: run

 public function run()
 {
     // Since we added the origfilename column in 5.0.0b1 we need to populate it
     Loader::block('library_file');
     $bl = new LibraryFileBlockController();
     $bl->populateOriginalFilenames();
     // install the new block types made available
     BlockType::installBlockType('flash_content');
     BlockType::installBlockType('guestbook');
     BlockType::installBlockType('slideshow');
     BlockType::installBlockType('search');
     BlockType::installBlockType('google_map');
     BlockType::installBlockType('video');
     BlockType::installBlockType('rss_displayer');
     BlockType::installBlockType('youtube');
     BlockType::installBlockType('survey');
     // rename external form
     $bt = BlockType::getByHandle('custom_form');
     $db = Loader::db();
     $tables = $db->MetaTables('TABLES');
     if (isset($tables['btCustomForm']) && !isset($tables['btExternalForm'])) {
         $db->Execute("alter table btCustomForm rename btExternalForm");
     }
     if (is_object($bt)) {
         BlockType::installBlockType('external_form', $bt->getBlockTypeID());
     }
     // add new theme
     $th = PageTheme::getByHandle('greensalad');
     if (!is_object($th)) {
         PageTheme::add('greensalad');
     }
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:32,代码来源:version_500b1.php

示例3: run

 public function run()
 {
     $sp = Page::getByPath('/dashboard/system/seo/excluded');
     if (!is_object($sp) || $sp->isError()) {
         $sp = SinglePage::add('/dashboard/system/seo/excluded');
         $sp->update(array('cName' => t('Excluded URL Word List')));
         $sp->setAttribute('meta_keywords', 'pretty, slug');
     }
     $bt = BlockType::getByHandle('next_previous');
     if (is_object($bt)) {
         $bt->refresh();
     }
     $db = Loader::db();
     $columns = $db->MetaColumns('Pages');
     if (isset($columns['PTID'])) {
         $db->Execute('alter table Pages drop column ptID');
     }
     if (isset($columns['CTID'])) {
         $db->Execute('alter table Pages drop column ctID');
     }
     $bt = BlockType::getByHandle('search');
     if (is_object($bt)) {
         $bt->refresh();
     }
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:25,代码来源:version_561.php

示例4: up

 public function up(Schema $schema)
 {
     $bt = \BlockType::getByHandle('image_slider');
     if (is_object($bt)) {
         $bt->refresh();
     }
 }
开发者ID:kreativmind,项目名称:concrete5-5.7.0,代码行数:7,代码来源:Version20160314000000.php

示例5: run

 public function run()
 {
     $bt = BlockType::getByHandle('google_map');
     if (is_object($bt) && !$bt->isError()) {
         $bt->refresh();
     }
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:7,代码来源:version_5632.php

示例6: view

 public function view()
 {
     $uh = Loader::helper('concrete/urls');
     $bt = BlockType::getByHandle('switch_language');
     Loader::model('section', 'multilingual');
     $ml = MultilingualSection::getList();
     $c = Page::getCurrentPage();
     $al = MultilingualSection::getBySectionOfSite($c);
     $languages = array();
     $locale = ACTIVE_LOCALE;
     if (is_object($al)) {
         $locale = $al->getLanguage();
     }
     foreach ($ml as $m) {
         $languages[$m->getCollectionID()] = $m->getLanguageText($locale) . ' ' . (strlen($m->msIcon) ? '(' . $m->msIcon . ')' : '');
     }
     $this->set('languages', $languages);
     $this->set('languageSections', $ml);
     $this->set('action', $uh->getBlockTypeToolsURL($bt) . '/switch');
     if (is_object($al)) {
         $this->set('activeLanguage', $al->getCollectionID());
     }
     $pkg = Package::getByHandle('multilingual');
     $mdl = Loader::helper('default_language', 'multilingual');
     $this->set('defaultLanguage', $mdl->getSessionDefaultLocale());
     $this->set('cID', $c->getCollectionID());
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:27,代码来源:controller.php

示例7: addBlock

 public function addBlock($blockTypeHandle)
 {
     $bt = BlockType::getByHandle($blockTypeHandle);
     $cct = ComposerControlType::getByHandle('block');
     $control = $ctca->getPageTypeComposerControlByIdentifier($bt->getBlockID());
     // add control
     $composerFLS = $control->addToPageTypeComposerFormLayoutSet($this->layoutSet);
 }
开发者ID:ExchangeCore,项目名称:razor-commerce,代码行数:8,代码来源:Composer.php

示例8: save

	public function save() {	
		if (isset($this->notesBlock)) {
			$this->notesBlock->delete();
		}		
		$data['content'] = $this->post('dashboard_notes');
		$bt = BlockType::getByHandle('content');
		$this->uc->addBlock($bt, 'dashboard_notes', $data);
		$this->redirect('/dashboard/', 'module','notes','notes_saved'); 
	}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:9,代码来源:notes.php

示例9: getOrInstallBlockType

 private function getOrInstallBlockType($pkg, $btHandle)
 {
     $bt = BlockType::getByHandle($btHandle);
     if (empty($bt)) {
         BlockType::installBlockTypeFromPackage($btHandle, $pkg);
         $bt = BlockType::getByHandle($btHandle);
     }
     return $bt;
 }
开发者ID:Trapulo,项目名称:c5-bootstrap-autonav,代码行数:9,代码来源:controller.php

示例10: block_name_for_handle

 private function block_name_for_handle($handle)
 {
     if (empty($handle)) {
         return '';
     } else {
         $bt = BlockType::getByHandle($handle);
         return is_object($bt) ? $bt->getBlockTypeName() : '';
     }
 }
开发者ID:robchenski,项目名称:ids,代码行数:9,代码来源:designer_content.php

示例11: uninstall

 public function uninstall()
 {
     BlockType::getByHandle('tweetcrete')->controller->uninstall();
     parent::uninstall();
     //make sure the block table gets dropped
     $db = Loader::db();
     $db->Execute('DROP TABLE IF EXISTS btTweetcrete');
     $db->Execute('DROP TABLE IF EXISTS btTweetcreteUserOrHashSettings');
 }
开发者ID:robchenski,项目名称:ids,代码行数:9,代码来源:controller.php

示例12: up

 public function up(Schema $schema)
 {
     $bt = \BlockType::getByHandle('file');
     if (is_object($bt)) {
         $bt->refresh();
     }
     if (\Config::get('conversation.banned_words')) {
         \Config::set('conversations.banned_words', true);
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:10,代码来源:Version20150610000000.php

示例13: run

	public function run() {
		$bt = BlockType::getByHandle('image');
		if (is_object($bt)) { 
			$bt->refresh();
		}
		$bt = BlockType::getByHandle('form');
		if (is_object($bt)) { 
			$bt->refresh();
		}
	}
开发者ID:nbourguig,项目名称:concrete5,代码行数:10,代码来源:version_552.php

示例14: up

 public function up(Schema $schema)
 {
     try {
         $table = $schema->getTable('SystemDatabaseQueryLog');
         $table->addColumn('ID', 'integer', array('unsigned' => true, 'autoincrement' => true));
         $table->setPrimaryKey(array('ID'));
     } catch (\Exception $e) {
     }
     $db = \Database::connection();
     $db->executeQuery("DELETE FROM FileSetFiles WHERE fID NOT IN (SELECT fID FROM Files)");
     $db->executeQuery("DELETE FROM FileSearchIndexAttributes WHERE fID NOT IN (SELECT fID FROM Files)");
     $db->executeQuery("DELETE FROM DownloadStatistics WHERE fID NOT IN (SELECT fID FROM Files)");
     $db->executeQuery("DELETE FROM FilePermissionAssignments WHERE fID NOT IN (SELECT fID FROM Files)");
     $bt = \BlockType::getByHandle('page_list');
     if (is_object($bt)) {
         $bt->refresh();
     }
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:18,代码来源:Version20150731000000.php

示例15: testCoreImageBlockWithNoOverridesHasCorrectTemplates

 function testCoreImageBlockWithNoOverridesHasCorrectTemplates()
 {
     // Test a.
     $p = Page::getByID(1);
     $blocks = $p->getBlocks('Header');
     $b = $blocks[0];
     $bvt = new BlockViewTemplate($b);
     $this->assertEqual($bvt->getTemplate(), DIR_BASE_CORE . '/blocks/image/view.php', 'Test A');
     // Test b.
     $bt = BlockType::getByHandle('image');
     global $a, $ap, $c, $cp;
     if (is_object($bt)) {
         ob_start();
         $bv = new BlockView();
         $bv->render($bt, 'add', array('a' => $a, 'ap' => $ap, 'c' => $c, 'cp' => $cp));
         ob_end_clean();
     }
     $this->assertEqual($bv->getTemplate(), DIR_BASE_CORE . '/blocks/image/add.php', 'Test B');
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:19,代码来源:template_tests.php


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