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

PHP SinglePage类代码示例

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

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



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

示例1: install

 public function install()
 {
     $pkg = parent::install();
     Loader::model('single_page');
     Loader::model('job');
     // install job
     $jb = Job::installByPackage('generate_multilingual_sitemap', $pkg);
     $p = SinglePage::add('/dashboard/multilingual', $pkg);
     if (is_object($p)) {
         $p->update(array('cName' => t('Multilingual'), 'cDescription' => t('Translate your site.')));
     }
     $p1 = SinglePage::add('/dashboard/multilingual/setup', $pkg);
     if (is_object($p1)) {
         $p1->update(array('cName' => t('Setup'), 'cDescription' => ''));
     }
     $p2 = SinglePage::add('/dashboard/multilingual/page_report', $pkg);
     if (is_object($p2)) {
         $p2->update(array('cName' => t('Page Report'), 'cDescription' => ''));
     }
     BlockType::installBlockTypeFromPackage('switch_language', $pkg);
     $ak = CollectionAttributeKey::getByHandle('multilingual_exclude_from_copy');
     if (!is_object($ak)) {
         CollectionAttributeKey::add('BOOLEAN', array('akHandle' => 'multilingual_exclude_from_copy', 'akName' => t('Exclude from Internationalization Copy'), 'akIsSearchable' => true), $pkg);
     }
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:25,代码来源:controller.php


示例2: install

 public function install()
 {
     $pkg = parent::install();
     Loader::model('single_page');
     $main = SinglePage::add('/dashboard/multisite', $pkg);
     $mainSites = SinglePage::add('/dashboard/multisite/sites', $pkg);
 }
开发者ID:rmxdave,项目名称:multisite,代码行数:7,代码来源:controller.php


示例3: run

 public function run()
 {
     $db = Loader::db();
     $cnt = $db->GetOne('select count(*) from TaskPermissions where tpHandle = ?', array('delete_user'));
     if ($cnt < 1) {
         $g3 = Group::getByID(ADMIN_GROUP_ID);
         $tip = TaskPermission::addTask('delete_user', t('Delete Users'), false);
         if (is_object($g3)) {
             $tip->addAccess($g3);
         }
     }
     Loader::model('single_page');
     $sp = Page::getByPath('/dashboard/settings/multilingual');
     if ($sp->isError()) {
         $d1a = SinglePage::add('/dashboard/settings/multilingual');
         $d1a->update(array('cName' => t('Multilingual Setup')));
     }
     $sp = Page::getByPath('/dashboard/composer');
     if ($sp->isError()) {
         $d2 = SinglePage::add('/dashboard/composer');
         $d2->update(array('cName' => t('Composer Beta'), 'cDescription' => t('Write for your site.')));
     }
     $sp = Page::getByPath('/dashboard/composer/write');
     if ($sp->isError()) {
         $d3 = SinglePage::add('/dashboard/composer/write');
     }
     $sp = Page::getByPath('/dashboard/composer/drafts');
     if ($sp->isError()) {
         $d4 = SinglePage::add('/dashboard/composer/drafts');
     }
     $sp = Page::getByPath('/dashboard/pages/types/composer');
     if ($sp->isError()) {
         $d5 = SinglePage::add('/dashboard/pages/types/composer');
     }
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:35,代码来源:version_542.php


示例4: 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


示例5: run

 public function run()
 {
     // Since 5.1.0 we've moved around a number of pages in the dashboard
     Loader::model('single_page');
     // Rename Forms to Reports
     $p = Page::getByPath('/dashboard/form_results');
     // We can only run these once so we do a check to see if that's the case.
     if ($p->isError()) {
         return false;
     }
     $p->update(array('cName' => t('Reports'), 'cDescription' => t('Get data from forms and logs.'), 'cHandle' => 'reports'));
     $p->rescanCollectionPath();
     $p = SinglePage::getByID($p->getCollectionID());
     $p->refresh();
     $d3a = SinglePage::add('/dashboard/reports/forms');
     $d3b = SinglePage::add('/dashboard/reports/logs');
     $d3c = SinglePage::add('/dashboard/reports/database');
     $d4 = Page::getByPath('/dashboard/users');
     $d4a = SinglePage::add('/dashboard/users/search');
     $d4b = SinglePage::add('/dashboard/users/add');
     $d4c = SinglePage::add('/dashboard/users/groups');
     $d4d = Page::getByPath("/dashboard/users/attributes");
     $db = Loader::db();
     $db->query("update Pages set cDisplayOrder = 0 where cID = ?", array($d4a->getCollectionID()));
     $db->query("update Pages set cDisplayOrder = 1 where cID = ?", array($d4b->getCollectionID()));
     $db->query("update Pages set cDisplayOrder = 2 where cID = ?", array($d4c->getCollectionID()));
     $db->query("update Pages set cDisplayOrder = 3 where cID = ?", array($d4d->getCollectionID()));
     $p = Page::getByPath('/dashboard/groups');
     $p->delete();
     $p = Page::getByPath('/dashboard/collection_types');
     $p->update(array('cHandle' => 'pages'));
     $p->rescanCollectionPath();
     $p = SinglePage::getByID($p->getCollectionID());
     $p->refresh();
     $p = Page::getByPath('/dashboard/pages/attributes');
     $p->delete();
     $d7a = SinglePage::add('/dashboard/pages/themes');
     $d7b = SinglePage::add('/dashboard/pages/themes/add');
     $d7c = SinglePage::add('/dashboard/pages/themes/inspect');
     $d7d = SinglePage::add('/dashboard/pages/themes/customize');
     $d7e = SinglePage::add('/dashboard/pages/themes/marketplace');
     $d7f = SinglePage::add('/dashboard/pages/types');
     $d7g = SinglePage::add('/dashboard/pages/types/attributes');
     $d7h = SinglePage::add('/dashboard/pages/single');
     $p = Page::getByPath('/dashboard/themes');
     $p->delete();
     $d3a->update(array('cName' => t('Form Results'), 'cDescription' => t('Get submission data.')));
     $d4->update(array('cName' => t('Users and Groups'), 'cDescription' => t('Add and manage people.')));
     $d4a->update(array('cName' => t('Find Users')));
     $d4b->update(array('cName' => t('Add User')));
     $d4c->update(array('cName' => t('Groups')));
     $d4d->update(array('cName' => t('User Attributes')));
     $d7 = Page::getByPath('/dashboard/pages');
     $d7->update(array('cName' => t('Pages and Themes'), 'cDescription' => t('Reskin your site.')));
     $d7f->update(array('cName' => t('Page Types'), 'cDescription' => t('What goes in your site.')));
     $d7h->update(array('cName' => t('Single Pages')));
     $p = Page::getByPath('/dashboard/logs');
     $p->delete();
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:59,代码来源:version_510.php


示例6: install

 /**
  * Install package
  */
 public function install()
 {
     $pkg = parent::install();
     mkdir(DIR_CONFIG_SITE . '/pubkeys');
     Loader::model('single_page');
     $d = SinglePage::add('/pubkey', $pkg);
     $d->update(array('cFilename' => "/pubkey.php"));
 }
开发者ID:jasny,项目名称:php-pubkey,代码行数:11,代码来源:controller.php


示例7: install

 public function install()
 {
     $this->precheck();
     $this->load_required_models();
     $pkg = parent::install();
     $cp = SinglePage::add('/dashboard/problog/site_importer/', $pkg);
     $cp->update(array('cName' => t('ProBlog Importer'), 'cDescription' => t('Import XML Blog Data')));
 }
开发者ID:pranastae,项目名称:problog_importer,代码行数:8,代码来源:controller.php


示例8: install

 public function install()
 {
     $pkg = parent::install();
     // Add the dashboard pages
     $mainPage = SinglePage::add('/dashboard/lgt_events', $pkg);
     $listPage = SinglePage::add('/dashboard/lgt_events/list', $pkg);
     $addPage = SinglePage::add('/dashboard/lgt_events/add', $pkg);
 }
开发者ID:robmorris180,项目名称:lgt_events,代码行数:8,代码来源:controller.php


示例9: install

 public function install()
 {
     $pkg = parent::install();
     //Install dashboard page
     Loader::model('single_page');
     $newC = SinglePage::add('/dashboard/cobble', $pkg);
     $newC->update(array('cDescription' => 'A Diagnostic Tool for Concrete 5 '));
 }
开发者ID:Remo,项目名称:cobble,代码行数:8,代码来源:controller.php


示例10: install

 public function install()
 {
     $pkg = parent::install();
     //load all the stuff we need and define essentials
     Loader::model('single_page');
     // dashboard
     $p1 = SinglePage::add('/dashboard/wp_theme_importer/', $pkg);
     $p1->update(array('cName' => t("Worpress Theme Importer"), 'cDescription' => t("Concrete-ize Wordpress themes.")));
 }
开发者ID:notzen,项目名称:Concrete5-Wordpress-Theme-Importer,代码行数:9,代码来源:controller.php


示例11: run

	public function run() {
		$db = Loader::db();
		Loader::model('collection_attributes');
		Loader::model('single_page');
		Loader::model('file_version');
		
		// Add in stuff that may have gotten missed before
		$p = Page::getByPath('/profile');
		if ($p->isError()) {
			$d1 = SinglePage::add('/profile');
			$d2 = SinglePage::add('/profile/edit');
			$d3 = SinglePage::add('/profile/avatar');				
		}
		$p2 = Page::getByPath('/dashboard/users/registration');
		if ($p2->isError()) {
			$d4 = SinglePage::add('/dashboard/users/registration');
		}
		
		// Move any global blocks to new scrapbook page.
		$sc = Page::getByPath("/dashboard/scrapbook/global");
		$scn = Page::getByPath('/dashboard/scrapbook');
		$scu = Page::getByPath('/dashboard/scrapbook/user');
		if (!$sc->isError()) {
			$blocks = $sc->getBlocks("Global Scrapbook");
			if (count($blocks) > 0) {
				// we create the new shared scrapbook 1
				$a = Area::getOrCreate($scn, t('Shared Scrapbook 1'));
				foreach($blocks as $_b) {
					// we move them into the area on the new page. 
					$_b->move($scn, $a);
					$_b->refreshCacheAll();
				}
			}
			$sc->delete();
		}
		if (!$scu->isError()) {
			$scu->delete();
		}
		//add the new collection attribute keys
		$cak=CollectionAttributeKey::getByHandle('header_extra_content');
		if(!is_object($cak)) {
			CollectionAttributeKey::add('header_extra_content', t('Header Extra Content'), true, null, 'TEXT');
		}
		$cak=CollectionAttributeKey::getByHandle('exclude_search_index');
		if (!is_object($cak)) {
			CollectionAttributeKey::add('exclude_search_index', t('Exclude From Search Index'), true, null, 'BOOLEAN');
		}
		
		//convert file tags to new format, cleaned up with leading and trailing line breaks  
		$fileVersionsData=$db->GetAll('SELECT fID, fvID, fvTags FROM FileVersions');
		foreach($fileVersionsData as $fvData){
			$vals=array( FileVersion::cleanTags($fvData['fvTags']) , $fvData['fID'] , $fvData['fvID'] );
			$db->query('UPDATE FileVersions SET fvTags=? WHERE fID=? AND fvID=?',  $vals );
		}
	}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:55,代码来源:version_530.php


示例12: install

 public function install()
 {
     $pkg = parent::install();
     //Install block
     BlockType::installBlockTypeFromPackage('custom_contact_form', $pkg);
     //Install dashboard page
     Loader::model('single_page');
     $p = SinglePage::add('/dashboard/reports/custom_contact_form', $pkg);
     $p->update(array('cName' => t('Contact Form Submissions')));
     $p->setAttribute('icon_dashboard', 'icon-list-alt');
 }
开发者ID:felixb101,项目名称:c5_custom_contact_form,代码行数:11,代码来源:controller.php


示例13: _upgrade

 private function _upgrade(&$pkg)
 {
     Loader::model('single_page');
     $oldDashboardPage = Page::getByPath('/dashboard/pages/designer_content');
     if ($oldDashboardPage && is_object($oldDashboardPage) && $oldDashboardPage->getCollectionID()) {
         $oldDashboardPage->delete();
     }
     $newDashboardPage = Page::getByPath('/dashboard/blocks/designer_content');
     if (!$newDashboardPage || !is_object($newDashboardPage) || !$newDashboardPage->getCollectionID()) {
         $newDashboardPage = SinglePage::add('/dashboard/blocks/designer_content', $pkg);
     }
     $this->_setupDashboardIcon($newDashboardPage, 'icon-gift');
 }
开发者ID:robchenski,项目名称:ids,代码行数:13,代码来源:controller.php


示例14: run

	public function run() {
		// contains all the items that have changed from 5.0.0a1 to the next version
		$db = Loader::db();
		
		// create jobs dashboard page
		Loader::model("job");
		Loader::model('single_page');
		Job::installByHandle('index_search');
		$d11 = SinglePage::add('/dashboard/jobs');
		if (is_object($d11)) {
			$d11->update(array('cName'=>t('Maintenance'), 'cDescription'=>t('Run common cleanup tasks.')));
		}
	}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:13,代码来源:version_500a1.php


示例15: run

	public function run() {
		Loader::model("job");
		Loader::model('single_page');
		Job::installByHandle('generate_sitemap');
		$d1 = SinglePage::add('/download_file');
		if (is_object($d1)) {
			$d1->update(array('cName'=>'Download File'));
		}
		$d2 = SinglePage::add('/dashboard/logs');
		if (is_object($d2)) {
			$d2->update(array('cName'=>'Logging', 'cDescription' => 'Keep tabs on your site.'));
		}

	}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:14,代码来源:version_500b2.php


示例16: addSinglePage

 private function addSinglePage($path, $name, $description = '', $icon = '')
 {
     Loader::model('single_page');
     $page = Page::getByPath($path);
     if (is_object($page) && $page->getCollectionID() > 0) {
         return;
     }
     $sp = SinglePage::add($path, $this->pkg);
     $sp->update(array('cName' => $name, 'cDescription' => $description));
     if (version_compare(APP_VERSION, '5.6', '>')) {
         if ($icon != '') {
             $sp->setAttribute('icon_dashboard', $icon);
         }
     }
 }
开发者ID:haeflimi,项目名称:concrete5-composer-list,代码行数:15,代码来源:controller.php


示例17: install

 public function install()
 {
     $pkg = parent::install();
     Loader::model('single_page');
     Loader::model('attribute/categories/collection');
     // install attributes
     $cab1 = CollectionAttributeKey::add('BOOLEAN', array('akHandle' => 'easynews_section', 'akName' => t('NEWS Section'), 'akIsSearchable' => true), $pkg);
     //install pages
     $def = SinglePage::add('/dashboard/easy_news', $pkg);
     $def->update(array('cName' => 'Easy News', 'cDescription' => t('Manage site news.')));
     $def = SinglePage::add('/dashboard/easy_news/help', $pkg);
     $def->update(array('cName' => 'Easy News Help', 'cDescription' => t('Easy News help.')));
     //install block
     BlockType::installBlockTypeFromPackage('easynews_list', $pkg);
 }
开发者ID:hanicker,项目名称:Concrete5-EasyNews,代码行数:15,代码来源:controller.php


示例18: run

 public function run()
 {
     Loader::model('single_page');
     $sp = Page::getByPath('/dashboard/system/basics/interface');
     if ($sp->isError()) {
         $d1a = SinglePage::add('/dashboard/system/basics/interface');
         $d1a->update(array('cName' => t('Interface Preferences')));
     }
     $sp = Page::getByPath('/dashboard/news');
     if ($sp->isError()) {
         $d1a = SinglePage::add('/dashboard/news');
         $d1a->update(array('cName' => t('Newsflow')));
         $d1a->setAttribute('exclude_nav', 1);
         $d1a->setAttribute('exclude_search_index', 1);
     }
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:16,代码来源:version_551.php


示例19: testSystemPageBoolean

 public function testSystemPageBoolean()
 {
     SinglePage::add('/dashboard/reports');
     $reportsPage = Page::getByPath('/dashboard/reports');
     $this->assertEquals(true, $reportsPage->isSystemPage());
     $page2 = self::createPage('Awesome Page 2');
     $this->assertEquals(false, $page2->isSystemPage());
     $account = SinglePage::add('/account');
     SinglePage::add('/account/profile');
     $profile = Page::getByPath('/account/profile');
     $this->assertEquals(true, $account->isSystemPage());
     $this->assertEquals(true, $profile->isSystemPage());
     $page2->move($profile);
     $this->assertEquals(true, $page2->isSystemPage());
     $page2 = Page::getByPath('/account/profile/awesome-page-2');
     $this->assertEquals(true, $page2->isSystemPage());
 }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:17,代码来源:PageTest.php


示例20: importSinglePageStructure

	protected function importSinglePageStructure(SimpleXMLElement $sx) {
		Loader::model('single_page');
		if (isset($sx->singlepages)) {
			foreach($sx->singlepages->page as $p) {
				$pkg = ContentImporter::getPackageObject($p['package']);
				$spl = SinglePage::add($p['path'], $pkg);
				if (is_object($spl)) { 
					if (isset($p['root']) && $p['root'] == true) {
						$spl->moveToRoot();
					}
					if ($p['name']) {
						$spl->update(array('cName' => $p['name'], 'cDescription' => $p['description']));
					}
				}
			}
		}
	}
开发者ID:nbourguig,项目名称:concrete5,代码行数:17,代码来源:importer.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP Singleton类代码示例发布时间:2022-05-23
下一篇:
PHP SimpleXmlElement类代码示例发布时间: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