public function getForm($item, $description = '') { if ($item instanceof TaskPermission) { $tp = new TaskPermissionList(); $tp->add($item); } else { $tp = $item; } $gl = new GroupList($tp); $ul = new UserInfoList($tp); $uArray = $ul->getUserInfoList(); $gArray = $gl->getGroupList(); $tps = $tp->getTaskPermissions(); $html = ''; foreach ($tps as $_tp) { $html .= '<input type="hidden" name="tpID[]" value="' . $_tp->getTaskPermissionID() . '" />'; } $html .= '<a href="' . REL_DIR_FILES_TOOLS_REQUIRED . '/user_group_selector" id="ug-selector" dialog-modal="false" dialog-width="90%" dialog-title="' . t('Choose User/Group') . '" dialog-height="70%" class="ccm-button-right dialog-launch"><span><em>' . t('Add Group or User') . '</em></span></a>'; $html .= '<p>' . $description . '</p>'; $html .= '<div class="ccm-spacer"> </div><br/>'; $html .= '<div id="ccm-permissions-entities-wrapper" class="ccm-permissions-entities-wrapper"><div id="ccm-permissions-entity-base" class="ccm-permissions-entity-base">' . $this->getAccessRow($tp) . '</div>'; foreach ($gArray as $g) { $html .= $this->getAccessRow($tp, $g); } foreach ($uArray as $ui) { $html .= $this->getAccessRow($tp, $ui); } $html .= '</div>'; return $html; }
public function getForm($item, $description = '') { if ($item instanceof TaskPermission) { $tp = new TaskPermissionList(); $tp->add($item); } else { $tp = $item; } $gl = new GroupList($tp); $ul = new UserInfoList($tp); $uArray = $ul->getUserInfoList(); $gArray = $gl->getGroupList(); $tps = $tp->getTaskPermissions(); $html = ''; foreach($tps as $_tp) { $html .= '<input type="hidden" name="tpID[]" value="' . $_tp->getTaskPermissionID() . '" />'; } $html .= '<div class="ccm-pane-body">'; $html .= '<a class="btn ug-selector ccm-button-right dialog-launch" href="' . REL_DIR_FILES_TOOLS_REQUIRED . '/users/search_dialog?mode=choose_multiple" dialog-modal="false" dialog-width="90%" dialog-title="' . t('Add User') . '" dialog-height="70%">' . t('Add User') . '</a>'; $html .= '<a class="btn ug-selector ccm-button-right dialog-launch" style="margin-right: 5px" href="' . REL_DIR_FILES_TOOLS_REQUIRED . '/select_group" dialog-modal="false" dialog-title="' . t('Add Group') . '">' . t('Add Group') . '</a>'; $html .= '<p>' . $description . '</p>'; $html .= '<div id="ccm-permissions-entities-wrapper" class="ccm-permissions-entities-wrapper"><div id="ccm-permissions-entity-base" class="ccm-permissions-entity-base">' . $this->getAccessRow($tp) . '</div>'; foreach($gArray as $g) { $html .= $this->getAccessRow($tp, $g); } foreach($uArray as $ui) { $html .= $this->getAccessRow($tp, $ui); } $html .= '</div></div>'; return $html; }
.ccm-module form{ width:auto; height:auto; padding:0px; padding-bottom:10px; display:block; } .ccm-module form div.ccm-dashboard-inner{ margin-bottom:0px !important; } </style> <?php if ($this->controller->getTask() == 'access_task_permissions' || $this->controller->getTask() == 'save_task_permissions') { ?> <div style="width: 760px"> <?php $tp1 = TaskPermission::getByHandle('access_task_permissions'); if ($tp1->can()) { $ih = Loader::helper('concrete/interface'); $tps = array(TaskPermission::getByHandle('access_task_permissions'), TaskPermission::getByHandle('access_user_search'), TaskPermission::getByHandle('access_group_search'), TaskPermission::getByHandle('access_page_defaults'), TaskPermission::getByHandle('install_packages'), TaskPermission::getByHandle('uninstall_packages'), TaskPermission::getByHandle('backup'), TaskPermission::getByHandle('sudo')); $tpl = new TaskPermissionList(); foreach ($tps as $tp) { $tpl->add($tp); } ?> <h1><span><?php echo t('Task Permissions'); ?> </span></h1> <div class="ccm-dashboard-inner"> <form method="post" id="ccm-task-permissions" action="<?php echo $this->url('/dashboard/settings', 'save_task_permissions'); ?> "> <?php
if ($tp1->can()) { print $h->getDashboardPaneHeaderWrapper(t('Site Permissions'), false, false, false); $ih = Loader::helper('concrete/interface'); $tps = array( TaskPermission::getByHandle('access_task_permissions'), TaskPermission::getByHandle('access_sitemap'), TaskPermission::getByHandle('access_user_search'), TaskPermission::getByHandle('access_group_search'), TaskPermission::getByHandle('access_page_defaults'), TaskPermission::getByHandle('install_packages'), TaskPermission::getByHandle('uninstall_packages'), TaskPermission::getByHandle('backup'), TaskPermission::getByHandle('sudo'), TaskPermission::getByHandle('delete_user') ); $tpl = new TaskPermissionList(); foreach($tps as $tp) { $tpl->add($tp); } ?> <form method="post" id="ccm-task-permissions" action="<?php echo $this->url('/dashboard/system/permissions/tasks', 'save_task_permissions'); ?> "> <?php echo $this->controller->token->output('update_permissions'); ?> <? print Loader::helper('concrete/dashboard/task_permissions')->getForm($tpl, t('Set administrative access details.')); ?> <div class="ccm-pane-footer"> <? print $ih->submit(t('Save'), 'ccm-task-permissions', 'right', 'primary'); ?>
/** * Returns an array of package items (e.g. blocks, themes) */ public function getPackageItems() { $items = array(); Loader::model('single_page'); Loader::model('dashboard/homepage'); Loader::library('mail/importer'); Loader::model('job'); Loader::model('collection_types'); $items['attribute_categories'] = AttributeKeyCategory::getListByPackage($this); $items['attribute_keys'] = AttributeKey::getListByPackage($this); $items['attribute_sets'] = AttributeSet::getListByPackage($this); $items['page_types'] = CollectionType::getListByPackage($this); $items['mail_importers'] = MailImporter::getListByPackage($this); $items['dashboard_modules'] = DashboardHomepageView::getModules($this); $items['configuration_values'] = Config::getListByPackage($this); $items['block_types'] = BlockTypeList::getByPackage($this); $items['page_themes'] = PageTheme::getListByPackage($this); $tp = new TaskPermissionList(); $items['task_permissions'] = $tp->populatePackagePermissions($this); $items['single_pages'] = SinglePage::getListByPackage($this); $items['attribute_types'] = AttributeType::getListByPackage($this); $items['jobs'] = Job::getListByPackage($this); ksort($items); return $items; }
/** * Returns an array of package items (e.g. blocks, themes) */ public function getPackageItems() { $items = array(); Loader::model('single_page'); Loader::library('mail/importer'); Loader::model('job'); Loader::model('collection_types'); Loader::model('system/captcha/library'); Loader::model('system/antispam/library'); $items['attribute_categories'] = AttributeKeyCategory::getListByPackage($this); $items['attribute_keys'] = AttributeKey::getListByPackage($this); $items['attribute_sets'] = AttributeSet::getListByPackage($this); $items['page_types'] = CollectionType::getListByPackage($this); $items['mail_importers'] = MailImporter::getListByPackage($this); $items['configuration_values'] = Config::getListByPackage($this); $items['block_types'] = BlockTypeList::getByPackage($this); $items['page_themes'] = PageTheme::getListByPackage($this); $tp = new TaskPermissionList(); $items['task_permissions'] = $tp->populatePackagePermissions($this); $items['single_pages'] = SinglePage::getListByPackage($this); $items['attribute_types'] = AttributeType::getListByPackage($this); $items['captcha_libraries'] = SystemCaptchaLibrary::getListByPackage($this); $items['antispam_libraries'] = SystemAntispamLibrary::getListByPackage($this); $items['jobs'] = Job::getListByPackage($this); ksort($items); return $items; }
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); // now task permissions TaskPermissionList::export($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); }