public function reset_display_order() { if ($this->post()) { BlockTypeList::resetBlockTypeDisplayOrder(); $this->set('message', t('Display Order Reset.')); } $this->view(); }
public function run() { if (!Config::get('SITE_INSTALLED_APP_VERSION')) { Config::save('SITE_INSTALLED_APP_VERSION', Config::get('SITE_APP_VERSION')); } BlockTypeList::resetBlockTypeDisplayOrder(); $th = PageTheme::getByHandle('greek_yogurt'); if (!is_object($th)) { PageTheme::add('greek_yogurt'); } $bt = BlockType::getByHandle('core_scrapbook_display'); if (is_object($bt)) { $bt->refresh(); } $bt = BlockType::getByHandle('search'); if (is_object($bt)) { $bt->refresh(); } $sp = Page::getByPath('/dashboard/users/group_sets'); if ($sp->isError()) { $d11 = SinglePage::add('/dashboard/users/group_sets'); $d11->update(array('cName' => t('Group Sets'))); } $sp = Page::getByPath('/dashboard/system/seo/bulk_seo_tool'); if ($sp->isError()) { $d1a = SinglePage::add('/dashboard/system/seo/bulk_seo_tool'); $d1a->update(array('cName' => t('Bulk SEO Updater'))); } $sp = Page::getByPath('/dashboard/system/permissions/users'); if ($sp->isError()) { $d1a = SinglePage::add('/dashboard/system/permissions/users'); $d1a->update(array('cName' => t('User Permissions'))); } $sp = Page::getByPath('/dashboard/blocks/permissions'); if ($sp->isError()) { $d1a = SinglePage::add('/dashboard/blocks/permissions'); $d1a->update(array('cName' => t('Block & Stack Permissions'))); } $sp = Page::getByPath('/dashboard/system/permissions/advanced'); if ($sp->isError()) { $d1b = SinglePage::add('/dashboard/system/permissions/advanced'); $d1b->update(array('cName' => t('Advanced Permissions'))); } $sp = Page::getByPath('/dashboard/workflow'); if ($sp->isError()) { $d1a = SinglePage::add('/dashboard/workflow'); $d1a->update(array('cName' => t('Workflow'))); } $sp = Page::getByPath('/dashboard/workflow/list'); if ($sp->isError()) { $d1a = SinglePage::add('/dashboard/workflow/list'); } $sp = Page::getByPath('/dashboard/workflow/me'); if ($sp->isError()) { $d1a = SinglePage::add('/dashboard/workflow/me'); $d1a->update(array('cName' => t('Waiting for Me'))); } $sp = Page::getByPath('/dashboard/system/environment/proxy'); if ($sp->isError()) { $d1a = SinglePage::add('/dashboard/system/environment/proxy'); $d1a->update(array('cName' => t('Proxy Server'))); } // update meta keywords $pageKeywords = array('/dashboard/composer' => t('blog, blogging'), '/dashboard/composer/write' => t('new blog, write blog, blogging'), '/dashboard/composer/drafts' => t('blog drafts, composer'), '/dashboard/sitemap' => t('pages, add page, delete page, copy, move, alias'), '/dashboard/sitemap/full' => t('pages, add page, delete page, copy, move, alias'), '/dashboard/sitemap/explore' => t('pages, add page, delete page, copy, move, alias, bulk'), '/dashboard/sitemap/search' => t('find page, search page, search, find, pages, sitemap'), '/dashboard/files/search' => t('add file, delete file, copy, move, alias, resize, crop, rename, images, title, attribute'), '/dashboard/files/attributes' => t('file, file attributes, title, attribute, description, rename'), '/dashboard/files/sets' => t('files, category, categories'), '/dashboard/files/add_set' => t('new file set'), '/dashboard/users' => t('users, groups, people, find, delete user, remove user, change password, password'), '/dashboard/users/search' => t('find, search, people, delete user, remove user, change password, password'), '/dashboard/users/groups' => t('user, group, people, permissions, access, expire'), '/dashboard/users/attributes' => t('user attributes, user data, gather data, registration data'), '/dashboard/users/add' => t('new user, create'), '/dashboard/users/add_group' => t('new user group, new group, group, create'), '/dashboard/users/group_sets' => t('group set'), '/dashboard/reports' => t('forms, log, error, email, mysql, exception, survey'), '/dashboard/reports/statistics' => t('hits, pageviews, visitors, activity'), '/dashboard/reports/forms' => t('forms, questions, response, data'), '/dashboard/reports/surveys' => t('questions, quiz, response'), '/dashboard/reports/logs' => t('forms, log, error, email, mysql, exception, survey, history'), '/dashboard/pages/themes' => t('new theme, theme, active theme, change theme, template, css'), '/dashboard/pages/themes/add' => t('theme'), '/dashboard/pages/themes/inspect' => t('page types'), '/dashboard/pages/themes/customize' => t('custom theme, change theme, custom css, css'), '/dashboard/pages/types' => t('page type defaults, global block, global area, starter, template'), '/dashboard/pages/attributes' => t('page attributes, custom'), '/dashboard/pages/single' => t('single, page, custom, application'), '/dashboard/workflow' => t('add workflow, remove workflow'), '/dashboard/blocks/stacks' => t('stacks, reusable content, scrapbook, copy, paste, paste block, copy block, site name, logo'), '/dashboard/blocks/stacks/list' => t('edit stacks, view stacks, all stacks'), '/dashboard/blocks/types' => t('block, refresh, custom'), '/dashboard/extend' => t('add-on, addon, add on, package, applications, ecommerce, discussions, forums, themes, templates, blocks'), '/dashboard/extend/install' => t('add-on, addon, ecommerce, install, discussions, forums, themes, templates, blocks'), '/dashboard/extend/update' => t('update, upgrade'), '/dashboard/extend/connect' => t('concrete5.org, my account, marketplace'), '/dashboard/extend/themes' => t('buy theme, new theme, marketplace, template'), '/dashboard/extend/add-ons' => t('buy addon, buy add on, buy add-on, purchase addon, purchase add on, purchase add-on, find addon, new addon, marketplace'), '/dashboard/system' => t('dashboard, configuration'), '/dashboard/system/basics/site_name' => t('website name, title'), '/dashboard/system/basics/icons' => t('logo, favicon, iphone, icon, bookmark'), '/dashboard/system/basics/editor' => t('tinymce, content block, fonts, editor, content, overlay'), '/dashboard/system/basics/multilingual' => t('translate, translation, internationalization, multilingual'), '/dashboard/system/basics/timezone' => t('timezone, profile, locale'), '/dashboard/system/basics/interface' => t('interface, quick nav, dashboard background, background image'), '/dashboard/system/seo/urls' => t('vanity, pretty url, seo, pageview, view'), '/dashboard/system/seo/bulk_seo_tool' => t('bulk, seo, change keywords, engine, optimization, search'), '/dashboard/system/seo/tracking_codes' => t('traffic, statistics, google analytics, quant, pageviews, hits'), '/dashboard/system/seo/statistics' => t('turn off statistics, tracking, statistics, pageviews, hits'), '/dashboard/system/seo/search_index' => t('configure search, site search, search option'), '/dashboard/system/optimization/cache' => t('cache option, change cache, override, turn on cache, turn off cache, no cache, page cache, caching'), '/dashboard/system/optimization/clear_cache' => t('cache option, turn off cache, no cache, page cache, caching'), '/dashboard/system/optimization/jobs' => t('index search, reindex search, build sitemap, sitemap.xml, clear old versions, page versions, remove old'), '/dashboard/system/permissions/site' => t('editors, hide site, offline, private, public, access'), '/dashboard/system/permissions/files' => t('file options, file manager, upload, modify'), '/dashboard/system/permissions/file_types' => t('security, files, media, extension, manager, upload'), '/dashboard/system/permissions/tasks' => t('security, actions, administrator, admin, package, marketplace, search'), '/dashboard/system/permissions/ip_blacklist' => t('security, lock ip, lock out, block ip, address, restrict, access'), '/dashboard/system/permissions/captcha' => t('security, registration'), '/dashboard/system/permissions/antispam' => t('antispam, block spam, security'), '/dashboard/system/permissions/maintenance_mode' => t('lock site, under construction, hide, hidden'), '/dashboard/system/registration/postlogin' => t('profile, login, redirect, specific, dashboard, administrators'), '/dashboard/system/registration/profiles' => t('member profile, member page, community, forums, social, avatar'), '/dashboard/system/registration/public_registration' => t('signup, new user, community'), '/dashboard/system/mail' => t('smtp, mail settings'), '/dashboard/system/mail/method' => t('email server, mail settings, mail configuration, external, internal'), '/dashboard/system/mail/importers' => t('email server, mail settings, mail configuration, private message, message system, import, email, message'), '/dashboard/system/attributes' => t('attribute configuration'), '/dashboard/system/attributes/sets' => t('attributes, sets'), '/dashboard/system/attributes/types' => t('attributes, types'), '/dashboard/system/environment/info' => t('overrides, system info, debug, support, help'), '/dashboard/system/environment/debug' => t('errors, exceptions, develop, support, help'), '/dashboard/system/environment/logging' => t('email, logging, logs, smtp, pop, errors, mysql, log'), '/dashboard/system/environment/file_storage_locations' => t('security, alternate storage, hide files'), '/dashboard/system/environment/proxy' => t('network, proxy server'), '/dashboard/system/backup_restore' => t('export, backup, database, sql, mysql, encryption, restore'), '/dashboard/system/backup_restore/update' => t('upgrade, new version, update'), '/dashboard/system/backup_restore/database' => t('export, database, xml, starting, points, schema, refresh, custom, tables'), '/dashboard/system/seo/search_index' => t('configure search, site search, search option'), '/dashboard/system/optimization/cache' => t('cache option, change cache, override, turn on cache, turn off cache, no cache, page cache, caching')); foreach ($pageKeywords as $page => $keywords) { $p = Page::getByPath($page, 'ACTIVE'); $ak = CollectionAttributeKey::getByHandle('meta_keywords'); if (is_object($p) && !$p->isError() && $ak instanceof AttributeKey) { $p->setAttribute('meta_keywords', $keywords); } } // install the permissions from permissions.xml $this->installPermissionsAndWorkflow(); $this->addGlobalBlockPermissions(); $this->migratePagePermissions(); $this->migratePagePermissionPageTypes(); $this->migrateAreaPermissions(); $this->migrateAreaPermissionBlockTypes(); $this->migrateBlockPermissions(); $this->migrateFileSetPermissions(); $this->migrateAddFilePermissions(); $this->migrateFilePermissions(); $this->migrateTaskPermissions(); $this->migrateThemes(); $this->migratePageTypes(); $this->setupDashboardIcons(); }
/** * Removes the block type. Also removes instances of content. */ public function delete() { $db = Loader::db(); $r = $db->Execute('select cID, cvID, b.bID, arHandle from CollectionVersionBlocks cvb inner join Blocks b on b.bID = cvb.bID where btID = ?', array($this->getBlockTypeID())); while ($row = $r->FetchRow()) { $nc = Page::getByID($row['cID'], $row['cvID']); $b = Block::getByID($row['bID'], $nc, $row['arHandle']); if (is_object($b)) { $b->deleteBlock(); } } $ca = new Cache(); $ca->delete('blockTypeByID', $this->btID); $ca->delete('blockTypeByHandle', $this->btHandle); $ca->delete('blockTypeList', false); $db->Execute("delete from BlockTypes where btID = ?", array($this->btID)); //Remove gaps in display order numbering (to avoid future sorting errors) BlockTypeList::resetBlockTypeDisplayOrder('btDisplayOrder'); }