本文整理汇总了PHP中SinglePage::add方法的典型用法代码示例。如果您正苦于以下问题:PHP SinglePage::add方法的具体用法?PHP SinglePage::add怎么用?PHP SinglePage::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SinglePage
的用法示例。
在下文中一共展示了SinglePage::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例2: 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');
}
}
示例3: install
public function install()
{
$pkg = parent::install();
Loader::model('single_page');
$main = SinglePage::add('/dashboard/multisite', $pkg);
$mainSites = SinglePage::add('/dashboard/multisite/sites', $pkg);
}
示例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();
}
}
示例5: view
public function view($message = null, $error = null)
{
Loader::model('single_page');
$this->set('generated', SinglePage::getList());
if ($message && !$error) {
$this->set('message', $message);
} else {
if ($message) {
$this->error->add($message);
}
}
if ($this->isPost()) {
if ($this->token->validate('add_single_page')) {
$pathToNode = SinglePage::getPathToNode($this->post('pageURL'), false);
$path = SinglePage::sanitizePath($this->post('pageURL'));
if (strlen($pathToNode) > 0) {
// now we check to see if this is already added
$pc = Page::getByPath('/' . $path, 'RECENT');
if ($pc->getError() == COLLECTION_NOT_FOUND) {
SinglePage::add($this->post('pageURL'));
$this->redirect('/dashboard/pages/single', t('Page Successfully Added.'));
} else {
$this->redirect('/dashboard/pages/single', t("That page has already been added."), 1);
}
} else {
$this->redirect('/dashboard/pages/single', t('That specified path doesn\'t appear to be a valid static page.'), 1);
}
}
$this->redirect('/dashboard/pages/single', $this->token->getErrorMessage(), 1);
}
}
示例6: 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();
}
示例7: 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"));
}
示例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);
}
示例9: 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')));
}
示例10: 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 '));
}
示例11: 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.")));
}
示例12: 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 );
}
}
示例13: 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');
}
示例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.')));
}
}
示例15: _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');
}