SproutCMS

This is the code documentation for the SproutCMS project

class Admin

Useful functions for the admin

Source code (179 results)

/modules/Demo/admin_load.php   Highlighted file source

Line 17: Register::adminControllers('Karmabunny\Demo', [
Line 18: 'demo_item' => 'Admin\DemoItemAdminController',
Line 19: 'demo_item_category' => 'Admin\DemoItemCategoryAdminController',
Line 20: 'word' => 'Admin\WordAdminController',
Line 21: 'word_category' => 'Admin\WordCategoryAdminController',
Line 24: Register::adminTile(

/modules/Demo/Controllers/Admin/DemoItemAdminController.php   Highlighted file source

Line 14: namespace SproutModules\Karmabunny\Demo\Controllers\Admin;
Line 18: use Sprout\Controllers\Admin\HasCategoriesAdminController;
Line 19: use Sprout\Helpers\AdminAuth;
Line 29: * Handles admin processing for Demo items
Line 31: class DemoItemAdminController extends HasCategoriesAdminController
Line 63: $url = "admin/call/{$this->controller_name}/runWorker";
Line 80: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 114: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}
Line 145: AdminAuth::checkLogin();
Line 166: AdminAuth::checkLogin();

/modules/Demo/Controllers/Admin/DemoItemCategoryAdminController.php   Highlighted file source

Line 14: namespace SproutModules\Karmabunny\Demo\Controllers\Admin;
Line 16: use Sprout\Controllers\Admin\CategoryAdminController;
Line 22: class DemoItemCategoryAdminController extends CategoryAdminController

/modules/Demo/Controllers/Admin/WordAdminController.php   Highlighted file source

Line 14: namespace SproutModules\Karmabunny\Demo\Controllers\Admin;
Line 18: use Sprout\Controllers\Admin\HasCategoriesAdminController;
Line 23: * Handles admin processing for Words
Line 25: class WordAdminController extends HasCategoriesAdminController
Line 62: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 96: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}

/modules/Demo/Controllers/Admin/WordCategoryAdminController.php   Highlighted file source

Line 14: namespace SproutModules\Karmabunny\Demo\Controllers\Admin;
Line 16: use Sprout\Controllers\Admin\CategoryAdminController;
Line 22: class WordCategoryAdminController extends CategoryAdminController

/modules/HarborAndSprout/admin_load.php   Highlighted file source

Line 17: Register::adminControllers('Karmabunny\HarborAndSprout', [
Line 18: 'fruit' => 'Admin\FruitAdminController',
Line 19: 'fruit_category' => 'Admin\FruitCategoryAdminController',
Line 22: Register::adminTile(

/modules/HarborAndSprout/Controllers/HarborController.php   Highlighted file source

Line 9: use Sprout\Helpers\AdminAuth;
Line 25: $view = new View('modules/HarborAndSprout/admin/shopify_api_form');
Line 46: $view = new View('modules/HarborAndSprout/admin/drive_api_form');
Line 77: AdminAuth::checkLogin();
Line 89: AdminAuth::checkLogin();

/modules/HomePage/admin_load.php   Highlighted file source

Line 14: Sprout\Helpers\Register::adminControllers('Karmabunny\HomePage', ['home_page' => 'Admin\\HomePageAdminController']);

/modules/HomePage/Controllers/Admin/HomePageAdminController.php   Highlighted file source

Line 14: namespace SproutModules\Karmabunny\HomePage\Controllers\Admin;
Line 16: use Sprout\Controllers\Admin\ManagedAdminController;
Line 17: use Sprout\Controllers\Admin\PageAdminController;
Line 24: class HomePageAdminController extends ManagedAdminController
Line 55: $pages = new PageAdminController();
Line 65: $ctlr = new PageAdminController();

/modules/Welcome/Controllers/WelcomeController.php   Highlighted file source

Line 23: use Sprout\Helpers\AdminAuth;
Line 84: $skin = new View('sprout/admin/login_layout');
Line 122: $skin = new View('sprout/admin/login_layout');
Line 244: $skin = new View('sprout/admin/login_layout');
Line 311: $skin = new View('sprout/admin/login_layout');
Line 469: $skin = new View('sprout/admin/login_layout');
Line 486: $skin = new View('sprout/admin/login_layout');
Line 501: $users = AdminAuth::injectLocalSuperConf($_SESSION['supeop_config']['user'], $_SESSION['supeop_config']['hash'], $_SESSION['supeop_config']['salt']);
Line 606: $users = AdminAuth::injectLocalSuperConf($_GET['user'], $_GET['hash'], $_GET['salt']);
Line 614: $skin = new View('sprout/admin/login_layout');

/skin/default/partials/_google_analytics.php   Highlighted file source

Line 2: use Sprout\Helpers\AdminAuth;
Line 12: } else if (!$analytics_id or AdminAuth::isLoggedIn()) {
Line 13: // Don't log analytics for admin users or if no config

/skin/default/partials/_google_analytics.php   Highlighted file source

Line 2: use Sprout\Helpers\AdminAuth;
Line 12: } else if (!$analytics_id or AdminAuth::isLoggedIn()) {
Line 13: // Don't log analytics for admin users or if no config

/sprout/config/page.php   Highlighted file source

Line 21: * @see PageAdminController

/sprout/config/page.php   Highlighted file source

Line 21: * @see PageAdminController

/sprout/config/routes.php   Highlighted file source

Line 28: // $config['admin/edit/.+'] = 'AdminController/edit/$1';
Line 29: $config['admin_ajax/widget_settings/([^/]+)'] = 'AdminAjaxController/widgetSettings/$1';
Line 30: $config['admin_ajax/widget_disp_conds'] = 'AdminAjaxController/widgetDispConds';
Line 31: $config['admin_ajax/widget_disp_cond_params'] = 'AdminAjaxController/widgetDispCondParams';
Line 32: $config['admin_ajax/add_addon/([0-9]+)/([^/]+)'] = 'AdminAjaxController/addAddon/$1/$2';
Line 33: $config['admin_ajax/footer_compat'] = 'AdminAjaxController/footerCompat';
Line 34: $config['admin_ajax/get_tag_suggestions/([^/]+)'] = 'AdminAjaxController/getTagSuggestions/$1';
Line 35: $config['admin_ajax/get_tag_suggestions'] = 'AdminAjaxController/getTagSuggestions';
Line 36: $config['admin_ajax/get_entrance_arguments/([^/]+)'] = 'AdminAjaxController/getEntranceArguments/$1';
Line 37: $config['admin_ajax/get_entrance_arguments'] = 'AdminAjaxController/getEntranceArguments';
Line 38: $config['admin_ajax/add_category'] = 'AdminAjaxController/addCategory';
Line 39: $config['admin_ajax/attr_editor'] = 'AdminAjaxController/attrEditor';
Line 40: $config['admin_ajax/lnk_editor'] = 'AdminAjaxController/lnkEditor';
Line 41: $config['admin_ajax/tour_complete/([-_a-zA-Z0-9]+)'] = 'AdminAjaxController/setTourCompleted/$1';
Line 42: $config['admin_ajax/richtext_import/([^/]+)'] = 'AdminAjaxController/richtextImport/$1';
Line 43: $config['admin_ajax/richtext_import_iframe'] = 'AdminAjaxController/richtextImportIframe';
Line 44: $config['admin_ajax/lnk_editor'] = 'AdminAjaxController/lnkEditor';
Line 45: $config['admin_ajax/style_guide_demo_conditions'] = 'AdminAjaxController/styleGuideDemoConditions';
Line 47: $config['admin/?'] = 'AdminController/index';
Line 48: $config['admin/login'] = 'AdminController/login';
Line 49: $config['admin/login_action'] = 'AdminController/loginAction';
Line 50: $config['admin/login-two-factor'] = 'AdminController/loginTwoFactor';
Line 51: $config['admin/login-two-factor-action'] = 'AdminController/loginTwoFactorAction';
Line 52: $config['admin/logout'] = 'AdminController/logout';
Line 53: $config['admin/set_richtext/([^/]+)'] = 'AdminController/setRichtext/$1';
Line 54: $config['admin/style_guide'] = 'AdminController/styleGuide/index';
Line 55: $config['admin/style_guide/([_a-z]+)'] = 'AdminController/styleGuide/$1';
Line 56: $config['admin/dashboard'] = 'AdminController/dashboard';
Line 57: $config['admin/close_firstrun'] = 'AdminController/closeFirstrun';
Line 58: $config['admin/intro/([^/]+)'] = 'AdminController/intro/$1';
Line 59: $config['admin/search/([^/]+)'] = 'AdminController/search/$1';
Line 60: $config['admin/contents/([^/]+)'] = 'AdminController/contents/$1';
Line 61: $config['admin/export/([^/]+)'] = 'AdminController/export/$1';
Line 62: $config['admin/export_action/([^/]+)'] = 'AdminController/exportAction/$1';
Line 63: $config['admin/import_upload/([^/]+)'] = 'AdminController/importUpload/$1';
Line 64: $config['admin/import_upload_action/([^/]+)'] = 'AdminController/importUploadAction/$1';
Line 65: $config['admin/import_options/([^/]+)'] = 'AdminController/importOptions/$1';
Line 66: $config['admin/import_action/([^/]+)'] = 'AdminController/importAction/$1';
Line 67: $config['admin/add/([^/]+)'] = 'AdminController/add/$1';
Line 68: $config['admin/add_save/([^/]+)'] = 'AdminController/addSave/$1';
Line 69: $config['admin/edit/([^/]+)/([0-9]+)'] = 'AdminController/edit/$1/$2';
Line 70: $config['admin/edit_save/([^/]+)/([0-9]+)'] = 'AdminController/editSave/$1/$2';
Line 71: $config['admin/delete/([^/]+)/([0-9]+)'] = 'AdminController/delete/$1/$2';
Line 72: $config['admin/delete_save/([^/]+)/([0-9]+)'] = 'AdminController/deleteSave/$1/$2';
Line 73: $config['admin/restore/([0-9]+)'] = 'AdminController/restore/$1';
Line 74: $config['admin/duplicate/([^/]+)/([0-9]+)'] = 'AdminController/duplicate/$1/$2';
Line 75: $config['admin/duplicate_save/([^/]+)/([0-9]+)'] = 'AdminController/duplicateSave/$1/$2';
Line 76: $config['admin/moderate'] = 'AdminController/moderate';
Line 77: $config['admin/moderate_action'] = 'AdminController/moderateAction';
Line 78: $config['admin/extra/(.+)'] = 'AdminController/extra/$1';
Line 79: $config['admin/call/([^/]+)/(.+)'] = 'AdminController/call/$1/$2';
Line 80: $config['admin/set_active_subsite'] = 'AdminController/setActiveSubsite';
Line 81: $config['admin/ajax_unlock'] = 'AdminController/ajaxUnlock';
Line 82: $config['admin/user-agent'] = 'AdminController/userAgent';
Line 83: $config['admin/heartbeat'] = 'AdminController/heartbeat';

/sprout/config/routes.php   Highlighted file source

Line 28: // $config['admin/edit/.+'] = 'AdminController/edit/$1';
Line 29: $config['admin_ajax/widget_settings/([^/]+)'] = 'AdminAjaxController/widgetSettings/$1';
Line 30: $config['admin_ajax/widget_disp_conds'] = 'AdminAjaxController/widgetDispConds';
Line 31: $config['admin_ajax/widget_disp_cond_params'] = 'AdminAjaxController/widgetDispCondParams';
Line 32: $config['admin_ajax/add_addon/([0-9]+)/([^/]+)'] = 'AdminAjaxController/addAddon/$1/$2';
Line 33: $config['admin_ajax/footer_compat'] = 'AdminAjaxController/footerCompat';
Line 34: $config['admin_ajax/get_tag_suggestions/([^/]+)'] = 'AdminAjaxController/getTagSuggestions/$1';
Line 35: $config['admin_ajax/get_tag_suggestions'] = 'AdminAjaxController/getTagSuggestions';
Line 36: $config['admin_ajax/get_entrance_arguments/([^/]+)'] = 'AdminAjaxController/getEntranceArguments/$1';
Line 37: $config['admin_ajax/get_entrance_arguments'] = 'AdminAjaxController/getEntranceArguments';
Line 38: $config['admin_ajax/add_category'] = 'AdminAjaxController/addCategory';
Line 39: $config['admin_ajax/attr_editor'] = 'AdminAjaxController/attrEditor';
Line 40: $config['admin_ajax/lnk_editor'] = 'AdminAjaxController/lnkEditor';
Line 41: $config['admin_ajax/tour_complete/([-_a-zA-Z0-9]+)'] = 'AdminAjaxController/setTourCompleted/$1';
Line 42: $config['admin_ajax/richtext_import/([^/]+)'] = 'AdminAjaxController/richtextImport/$1';
Line 43: $config['admin_ajax/richtext_import_iframe'] = 'AdminAjaxController/richtextImportIframe';
Line 44: $config['admin_ajax/lnk_editor'] = 'AdminAjaxController/lnkEditor';
Line 45: $config['admin_ajax/style_guide_demo_conditions'] = 'AdminAjaxController/styleGuideDemoConditions';
Line 47: $config['admin/?'] = 'AdminController/index';
Line 48: $config['admin/login'] = 'AdminController/login';
Line 49: $config['admin/login_action'] = 'AdminController/loginAction';
Line 50: $config['admin/login-two-factor'] = 'AdminController/loginTwoFactor';
Line 51: $config['admin/login-two-factor-action'] = 'AdminController/loginTwoFactorAction';
Line 52: $config['admin/logout'] = 'AdminController/logout';
Line 53: $config['admin/set_richtext/([^/]+)'] = 'AdminController/setRichtext/$1';
Line 54: $config['admin/style_guide'] = 'AdminController/styleGuide/index';
Line 55: $config['admin/style_guide/([_a-z]+)'] = 'AdminController/styleGuide/$1';
Line 56: $config['admin/dashboard'] = 'AdminController/dashboard';
Line 57: $config['admin/close_firstrun'] = 'AdminController/closeFirstrun';
Line 58: $config['admin/intro/([^/]+)'] = 'AdminController/intro/$1';
Line 59: $config['admin/search/([^/]+)'] = 'AdminController/search/$1';
Line 60: $config['admin/contents/([^/]+)'] = 'AdminController/contents/$1';
Line 61: $config['admin/export/([^/]+)'] = 'AdminController/export/$1';
Line 62: $config['admin/export_action/([^/]+)'] = 'AdminController/exportAction/$1';
Line 63: $config['admin/import_upload/([^/]+)'] = 'AdminController/importUpload/$1';
Line 64: $config['admin/import_upload_action/([^/]+)'] = 'AdminController/importUploadAction/$1';
Line 65: $config['admin/import_options/([^/]+)'] = 'AdminController/importOptions/$1';
Line 66: $config['admin/import_action/([^/]+)'] = 'AdminController/importAction/$1';
Line 67: $config['admin/add/([^/]+)'] = 'AdminController/add/$1';
Line 68: $config['admin/add_save/([^/]+)'] = 'AdminController/addSave/$1';
Line 69: $config['admin/edit/([^/]+)/([0-9]+)'] = 'AdminController/edit/$1/$2';
Line 70: $config['admin/edit_save/([^/]+)/([0-9]+)'] = 'AdminController/editSave/$1/$2';
Line 71: $config['admin/delete/([^/]+)/([0-9]+)'] = 'AdminController/delete/$1/$2';
Line 72: $config['admin/delete_save/([^/]+)/([0-9]+)'] = 'AdminController/deleteSave/$1/$2';
Line 73: $config['admin/restore/([0-9]+)'] = 'AdminController/restore/$1';
Line 74: $config['admin/duplicate/([^/]+)/([0-9]+)'] = 'AdminController/duplicate/$1/$2';
Line 75: $config['admin/duplicate_save/([^/]+)/([0-9]+)'] = 'AdminController/duplicateSave/$1/$2';
Line 76: $config['admin/moderate'] = 'AdminController/moderate';
Line 77: $config['admin/moderate_action'] = 'AdminController/moderateAction';
Line 78: $config['admin/extra/(.+)'] = 'AdminController/extra/$1';
Line 79: $config['admin/call/([^/]+)/(.+)'] = 'AdminController/call/$1/$2';
Line 80: $config['admin/set_active_subsite'] = 'AdminController/setActiveSubsite';
Line 81: $config['admin/ajax_unlock'] = 'AdminController/ajaxUnlock';
Line 82: $config['admin/user-agent'] = 'AdminController/userAgent';
Line 83: $config['admin/heartbeat'] = 'AdminController/heartbeat';

/sprout/Controllers/Admin/ActionLogAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 35: * Handles admin processing for the action log, which is a record of changes to database content
Line 37: class ActionLogAdminController extends ManagedAdminController
Line 88: $tools[] = '<li><a href="SITE/admin/extra/action_log/login_attempts">View login attempts</a></li>';
Line 160: $ret .= "<li class=\"action-log\"><a href=\"admin/contents/action_log?record_table=";

/sprout/Controllers/Admin/ActionLogAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 35: * Handles admin processing for the action log, which is a record of changes to database content
Line 37: class ActionLogAdminController extends ManagedAdminController
Line 88: $tools[] = '<li><a href="SITE/admin/extra/action_log/login_attempts">View login attempts</a></li>';
Line 160: $ret .= "<li class=\"action-log\"><a href=\"admin/contents/action_log?record_table=";

/sprout/Controllers/Admin/CategoryAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 19: use Sprout\Helpers\AdminAuth;
Line 20: use Sprout\Helpers\AdminError;
Line 21: use Sprout\Helpers\AdminPerms;
Line 36: abstract class CategoryAdminController extends ManagedAdminController {
Line 46: protected $add_view_name = 'sprout/admin/categories_add';
Line 51: protected $edit_view_name = 'sprout/admin/categories_edit';
Line 65: $parent_class = preg_replace('/CategoryAdminController$/', 'AdminController', get_class($this));
Line 133: if (!empty($_SESSION['admin']['field_values'])) {
Line 134: $data = $_SESSION['admin']['field_values'];
Line 135: unset($_SESSION['admin']['field_values']);
Line 143: if (!empty($_SESSION['admin']['field_errors'])) {
Line 144: $view->errors = $_SESSION['admin']['field_errors'];
Line 166: $_SESSION['admin']['field_values'] = $_POST;
Line 172: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 210: if (!empty($_SESSION['admin']['field_values'])) {
Line 211: $data = $_SESSION['admin']['field_values'];
Line 212: unset ($_SESSION['admin']['field_values']);
Line 222: if (!empty($_SESSION['admin']['field_errors'])) {
Line 223: $view->errors = $_SESSION['admin']['field_errors'];
Line 248: Url::redirect('admin/edit/' . $this->controller_name . '/' . $item_id);
Line 258: $_SESSION['admin']['field_values'] = $_POST;
Line 259: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 272: $update_fields['show_admin'] = $_POST['show_admin'];
Line 310: $view = new View('sprout/admin/categories_delete');
Line 337: Url::redirect('admin/delete/' . $this->controller_name . '/' . $id);
Line 383: if (! AdminPerms::controllerAccess($this->parent_inst->getControllerName(), 'reorder')) {
Line 384: return new AdminError('Access denied');
Line 396: return new AdminError('Invalid id specified - category does not exist');
Line 409: return new AdminError('This category does not have enough items in it for re-ordering.');
Line 417: $view = new View('sprout/admin/categories_reorder');
Line 434: AdminAuth::checkLogin();
Line 439: if (! AdminPerms::controllerAccess($this->parent_inst->getControllerName(), 'reorder')) {
Line 441: Url::redirect('admin/contents/' . $this->controller_name);
Line 458: Url::redirect("admin/contents/{$item_name}?_category_id={$category_id}");
Line 469: if (! AdminPerms::controllerAccess($this->parent_inst->getControllerName(), 'categories')) {
Line 470: return new AdminError('Access denied');
Line 478: return new AdminError('There are not enough categories for re-ordering.');
Line 482: $view = new View('sprout/admin/categories_reorder');
Line 483: $view->action = 'admin/call/' . $this->controller_name . '/reorderCategoriesSave';
Line 495: AdminAuth::checkLogin();
Line 498: if (! AdminPerms::controllerAccess($this->parent_inst->getControllerName(), 'categories')) {
Line 500: Url::redirect('admin/contents/' . $this->controller_name);
Line 515: Url::redirect("admin/contents/{$item_name}");
Line 527: $data['show_admin'] = 0;
Line 542: $data['show_admin'] = 1;

/sprout/Controllers/Admin/CategoryAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 19: use Sprout\Helpers\AdminAuth;
Line 20: use Sprout\Helpers\AdminError;
Line 21: use Sprout\Helpers\AdminPerms;
Line 36: abstract class CategoryAdminController extends ManagedAdminController {
Line 46: protected $add_view_name = 'sprout/admin/categories_add';
Line 51: protected $edit_view_name = 'sprout/admin/categories_edit';
Line 65: $parent_class = preg_replace('/CategoryAdminController$/', 'AdminController', get_class($this));
Line 133: if (!empty($_SESSION['admin']['field_values'])) {
Line 134: $data = $_SESSION['admin']['field_values'];
Line 135: unset($_SESSION['admin']['field_values']);
Line 143: if (!empty($_SESSION['admin']['field_errors'])) {
Line 144: $view->errors = $_SESSION['admin']['field_errors'];
Line 166: $_SESSION['admin']['field_values'] = $_POST;
Line 172: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 210: if (!empty($_SESSION['admin']['field_values'])) {
Line 211: $data = $_SESSION['admin']['field_values'];
Line 212: unset ($_SESSION['admin']['field_values']);
Line 222: if (!empty($_SESSION['admin']['field_errors'])) {
Line 223: $view->errors = $_SESSION['admin']['field_errors'];
Line 248: Url::redirect('admin/edit/' . $this->controller_name . '/' . $item_id);
Line 258: $_SESSION['admin']['field_values'] = $_POST;
Line 259: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 272: $update_fields['show_admin'] = $_POST['show_admin'];
Line 310: $view = new View('sprout/admin/categories_delete');
Line 337: Url::redirect('admin/delete/' . $this->controller_name . '/' . $id);
Line 383: if (! AdminPerms::controllerAccess($this->parent_inst->getControllerName(), 'reorder')) {
Line 384: return new AdminError('Access denied');
Line 396: return new AdminError('Invalid id specified - category does not exist');
Line 409: return new AdminError('This category does not have enough items in it for re-ordering.');
Line 417: $view = new View('sprout/admin/categories_reorder');
Line 434: AdminAuth::checkLogin();
Line 439: if (! AdminPerms::controllerAccess($this->parent_inst->getControllerName(), 'reorder')) {
Line 441: Url::redirect('admin/contents/' . $this->controller_name);
Line 458: Url::redirect("admin/contents/{$item_name}?_category_id={$category_id}");
Line 469: if (! AdminPerms::controllerAccess($this->parent_inst->getControllerName(), 'categories')) {
Line 470: return new AdminError('Access denied');
Line 478: return new AdminError('There are not enough categories for re-ordering.');
Line 482: $view = new View('sprout/admin/categories_reorder');
Line 483: $view->action = 'admin/call/' . $this->controller_name . '/reorderCategoriesSave';
Line 495: AdminAuth::checkLogin();
Line 498: if (! AdminPerms::controllerAccess($this->parent_inst->getControllerName(), 'categories')) {
Line 500: Url::redirect('admin/contents/' . $this->controller_name);
Line 515: Url::redirect("admin/contents/{$item_name}");
Line 527: $data['show_admin'] = 0;
Line 542: $data['show_admin'] = 1;

/sprout/Controllers/Admin/ContentSubscriptionAdminController.php   Highlighted file source

Line 13: namespace Sprout\Controllers\Admin;
Line 24: class ContentSubscriptionAdminController extends ManagedAdminController
Line 77: $itemlist->addAction('Duplicate', "SITE/admin/duplicate/{$this->controller_name}/%%", 'button-grey icon-before icon-add');
Line 80: $itemlist->addAction('Delete', "SITE/admin/delete/{$this->controller_name}/%%", 'button button-red icon-before icon-delete');
Line 94: $outer = new View("sprout/admin/generic_itemlist_outer");

/sprout/Controllers/Admin/ContentSubscriptionAdminController.php   Highlighted file source

Line 13: namespace Sprout\Controllers\Admin;
Line 24: class ContentSubscriptionAdminController extends ManagedAdminController
Line 77: $itemlist->addAction('Duplicate', "SITE/admin/duplicate/{$this->controller_name}/%%", 'button-grey icon-before icon-add');
Line 80: $itemlist->addAction('Delete', "SITE/admin/delete/{$this->controller_name}/%%", 'button button-red icon-before icon-delete');
Line 94: $outer = new View("sprout/admin/generic_itemlist_outer");

/sprout/Controllers/Admin/CronJobAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 18: use Sprout\Helpers\AdminAuth;
Line 33: class CronJobAdminController extends ListAdminController
Line 120: $view = new View('sprout/admin/cron_job_manual_run');
Line 135: AdminAuth::checkLogin();
Line 140: Url::redirect('admin/extra/cron_job/manual_run');
Line 156: Url::redirect('admin/extra/cron_job/manual_run');

/sprout/Controllers/Admin/CronJobAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 18: use Sprout\Helpers\AdminAuth;
Line 33: class CronJobAdminController extends ListAdminController
Line 120: $view = new View('sprout/admin/cron_job_manual_run');
Line 135: AdminAuth::checkLogin();
Line 140: Url::redirect('admin/extra/cron_job/manual_run');
Line 156: Url::redirect('admin/extra/cron_job/manual_run');

/sprout/Controllers/Admin/DocumentTypeAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 22: * Handles admin processing for Document types
Line 24: class DocumentTypeAdminController extends ListAdminController
Line 68: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 106: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}

/sprout/Controllers/Admin/DocumentTypeAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 22: * Handles admin processing for Document types
Line 24: class DocumentTypeAdminController extends ListAdminController
Line 68: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 106: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}

/sprout/Controllers/Admin/EmailTextAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 24: class EmailTextAdminController extends ManagedAdminController
Line 72: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}
Line 93: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 100: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();

/sprout/Controllers/Admin/EmailTextAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 24: class EmailTextAdminController extends ManagedAdminController
Line 72: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}
Line 93: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 100: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();

/sprout/Controllers/Admin/ExtraPageAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 16: use Sprout\Helpers\AdminAuth;
Line 29: class ExtraPageAdminController extends ManagedAdminController
Line 52: 'subsite_id = ' . ((int)$_SESSION['admin']['active_subsite']),
Line 78: $res = Pdb::query($q, [$_SESSION['admin']['active_subsite']], 'pdo');
Line 87: $view = new View('sprout/admin/extra_page_sidebar');
Line 114: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 121: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 140: $extant_types = Pdb::q($q, [$_SESSION['admin']['active_subsite']], 'col');
Line 150: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 179: $update_fields['subsite_id'] = $_SESSION['admin']['active_subsite'];
Line 205: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}
Line 212: if (!AdminAuth::isSuper()) {

/sprout/Controllers/Admin/ExtraPageAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 16: use Sprout\Helpers\AdminAuth;
Line 29: class ExtraPageAdminController extends ManagedAdminController
Line 52: 'subsite_id = ' . ((int)$_SESSION['admin']['active_subsite']),
Line 78: $res = Pdb::query($q, [$_SESSION['admin']['active_subsite']], 'pdo');
Line 87: $view = new View('sprout/admin/extra_page_sidebar');
Line 114: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 121: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 140: $extant_types = Pdb::q($q, [$_SESSION['admin']['active_subsite']], 'col');
Line 150: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 179: $update_fields['subsite_id'] = $_SESSION['admin']['active_subsite'];
Line 205: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}
Line 212: if (!AdminAuth::isSuper()) {

/sprout/Controllers/Admin/FileAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 23: use Sprout\Helpers\Admin;
Line 24: use Sprout\Helpers\AdminAuth;
Line 25: use Sprout\Helpers\AdminPerms;
Line 60: class FileAdminController extends HasCategoriesAdminController implements FrontEndSearch
Line 115: $file_id = Admin::getRecordId();
Line 147: $opts['chunk_url'] = 'admin/call/file/ajaxDragdropChunk';
Line 148: $opts['done_url'] = 'admin/call/file/ajaxDragdropDone';
Line 149: $opts['form_url'] = 'admin/call/file/ajaxDragdropForm';
Line 150: $opts['cancel_url'] = 'admin/call/file/ajaxDragdropCancel';
Line 325: $view = new View('sprout/admin/file_add_dragdrop_form');
Line 491: $html .= '<p class="file-upload__item__feedback__name"><a href="admin/edit/file/' . $file_id . '" target="_blank">' . Enc::html($filename) . '</a></p>';
Line 573: if (! AdminPerms::controllerAccess('file', 'add')) {
Line 597: $temp_file = FileUpload::verify('admin_quick_upload', 'file', 0, $allowed_exts);
Line 652: if (!AdminPerms::controllerAccess('file', 'categories')) {
Line 740: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}
Line 748: 'url' => 'admin/extra/' . $this->controller_name . '/find_usage/' . $item_id,
Line 770: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 794: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 998: * They are removed later, when the deletion log is cleared; see {@see ActionLogAdminController::cronCleanup}.
Line 1052: AdminAuth::checkLogin();
Line 1148: $tools[] = '<li class="config"><a href="admin/extra/file/cleanup_invalid">Cleanup invalid files</a></li>';
Line 1150: if (AdminAuth::isSuper()) {
Line 1151: $tools[] = '<li class="config"><a href="admin/extra/file/redo_sizes">Recreate resized images</a></li>';
Line 1163: $view = new View("sprout/admin/file_cleanup_invalid");
Line 1189: * Does file cleanup - wrapper (admin)
Line 1193: AdminAuth::checkLogin();
Line 1200: Url::redirect('admin/extra/file/cleanup_invalid');
Line 1204: Url::redirect('admin/intro/file');
Line 1282: $view = new View("sprout/admin/file_contents_thumbs");
Line 1358: $view = new View('sprout/admin/file_selector_popup');
Line 1367: if (! AdminPerms::controllerAccess('file', 'add')) {
Line 1370: if (! AdminPerms::controllerAccess('file', 'contents')) {
Line 1373: $view->cat_create = AdminPerms::controllerAccess('file', 'categories');
Line 1384: if (! AdminPerms::controllerAccess('file', 'contents')) {
Line 1487: $out = '<form action="admin/call/file/redoSizesAction" method="post">';
Line 1505: AdminAuth::checkLogin();
Line 1512: Url::redirect('admin/intro/file');
Line 1529: $view = new View('sprout/admin/file_usage');

/sprout/Controllers/Admin/FileAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 23: use Sprout\Helpers\Admin;
Line 24: use Sprout\Helpers\AdminAuth;
Line 25: use Sprout\Helpers\AdminPerms;
Line 60: class FileAdminController extends HasCategoriesAdminController implements FrontEndSearch
Line 115: $file_id = Admin::getRecordId();
Line 147: $opts['chunk_url'] = 'admin/call/file/ajaxDragdropChunk';
Line 148: $opts['done_url'] = 'admin/call/file/ajaxDragdropDone';
Line 149: $opts['form_url'] = 'admin/call/file/ajaxDragdropForm';
Line 150: $opts['cancel_url'] = 'admin/call/file/ajaxDragdropCancel';
Line 325: $view = new View('sprout/admin/file_add_dragdrop_form');
Line 491: $html .= '<p class="file-upload__item__feedback__name"><a href="admin/edit/file/' . $file_id . '" target="_blank">' . Enc::html($filename) . '</a></p>';
Line 573: if (! AdminPerms::controllerAccess('file', 'add')) {
Line 597: $temp_file = FileUpload::verify('admin_quick_upload', 'file', 0, $allowed_exts);
Line 652: if (!AdminPerms::controllerAccess('file', 'categories')) {
Line 740: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}
Line 748: 'url' => 'admin/extra/' . $this->controller_name . '/find_usage/' . $item_id,
Line 770: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 794: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 998: * They are removed later, when the deletion log is cleared; see {@see ActionLogAdminController::cronCleanup}.
Line 1052: AdminAuth::checkLogin();
Line 1148: $tools[] = '<li class="config"><a href="admin/extra/file/cleanup_invalid">Cleanup invalid files</a></li>';
Line 1150: if (AdminAuth::isSuper()) {
Line 1151: $tools[] = '<li class="config"><a href="admin/extra/file/redo_sizes">Recreate resized images</a></li>';
Line 1163: $view = new View("sprout/admin/file_cleanup_invalid");
Line 1189: * Does file cleanup - wrapper (admin)
Line 1193: AdminAuth::checkLogin();
Line 1200: Url::redirect('admin/extra/file/cleanup_invalid');
Line 1204: Url::redirect('admin/intro/file');
Line 1282: $view = new View("sprout/admin/file_contents_thumbs");
Line 1358: $view = new View('sprout/admin/file_selector_popup');
Line 1367: if (! AdminPerms::controllerAccess('file', 'add')) {
Line 1370: if (! AdminPerms::controllerAccess('file', 'contents')) {
Line 1373: $view->cat_create = AdminPerms::controllerAccess('file', 'categories');
Line 1384: if (! AdminPerms::controllerAccess('file', 'contents')) {
Line 1487: $out = '<form action="admin/call/file/redoSizesAction" method="post">';
Line 1505: AdminAuth::checkLogin();
Line 1512: Url::redirect('admin/intro/file');
Line 1529: $view = new View('sprout/admin/file_usage');

/sprout/Controllers/Admin/FileCategoryAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 20: class FileCategoryAdminController extends CategoryAdminController

/sprout/Controllers/Admin/FileCategoryAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 20: class FileCategoryAdminController extends CategoryAdminController

/sprout/Controllers/Admin/HasCategoriesAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 20: use Sprout\Helpers\Admin;
Line 21: use Sprout\Helpers\AdminError;
Line 22: use Sprout\Helpers\AdminPerms;
Line 41: abstract class HasCategoriesAdminController extends ManagedAdminController {
Line 63: * You will need a "show_admin TINYINT UNSIGNED DEFAULT 1" column on the category table.
Line 139: $columns[] = 'categories.show_admin';
Line 143: $_GET['category_type'] = @$_SESSION['admin']['category_type'];
Line 152: $clause = Constants::$category_admin_where[$_GET['category_type']];
Line 155: $_SESSION['admin']['category_type'] = $_GET['category_type'];
Line 190: $view = new View('sprout/admin/categories_navigation');
Line 218: $tools['reorder'] = "<li class=\"reorder\"><a href=\"admin/extra/{$this->controller_name}_category/reorder_categories\">Reorder Categories</a></li>";
Line 334: $_GET['main_mode'] = @$_SESSION['admin'][$this->controller_name]['main_mode'];
Line 336: $_SESSION['admin'][$this->controller_name]['main_mode'] = $_GET['main_mode'];
Line 414: $itemlist->addAction('edit', "SITE/admin/edit/{$this->controller_name}/%%");
Line 419: $itemlist->addAction('Duplicate', "SITE/admin/duplicate/{$this->controller_name}/%%", 'button-grey icon-before icon-add');
Line 422: $itemlist->addAction('Delete', "SITE/admin/delete/{$this->controller_name}/%%", 'button button-red icon-before icon-delete');
Line 436: $outer = new View("sprout/admin/categories_itemlist_outer");
Line 458: $view = new View('sprout/admin/categories_import_options');
Line 467: Admin::setCategoryTablename($cats_table);
Line 468: Admin::setCategorySinglecat($this->category_single);
Line 508: if (!empty($_SESSION['admin']['field_values'])) {
Line 509: $data = $_SESSION['admin']['field_values'];
Line 510: unset($_SESSION['admin']['field_values']);
Line 514: if (!empty($_SESSION['admin']['field_errors'])) {
Line 515: $errors = $_SESSION['admin']['field_errors'];
Line 516: unset($_SESSION['admin']['field_errors']);
Line 519: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 520: Admin::setCategorySinglecat($this->category_single);
Line 543: $view = new View("{$view_dir}/admin/{$this->controller_name}_add");
Line 578: return new AdminError("Invalid id specified - {$single} does not exist");
Line 583: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 584: Admin::setCategorySinglecat($this->category_single);
Line 612: $view = new View("{$view_dir}/admin/{$this->controller_name}_edit");
Line 616: if (!empty($_SESSION['admin']['field_values'])) {
Line 617: $data = array_merge($data, $_SESSION['admin']['field_values']);
Line 618: unset ($_SESSION['admin']['field_values']);
Line 622: if (!empty($_SESSION['admin']['field_errors'])) {
Line 623: $errors = $_SESSION['admin']['field_errors'];
Line 624: unset($_SESSION['admin']['field_errors']);
Line 658: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 659: Admin::setCategorySinglecat($this->category_single);
Line 676: if (!empty($_SESSION['admin']['field_values'])) {
Line 677: $data = array_merge($data, $_SESSION['admin']['field_values']);
Line 678: unset ($_SESSION['admin']['field_values']);
Line 682: if (!empty($_SESSION['admin']['field_errors'])) {
Line 683: $errors = $_SESSION['admin']['field_errors'];
Line 684: unset($_SESSION['admin']['field_errors']);
Line 708: $view = new View("{$view_dir}/admin/{$this->controller_name}_edit");
Line 831: if (! AdminPerms::controllerAccess($this->getControllerName(), 'edit')) {
Line 832: return new AdminError('Access denied');
Line 837: Url::redirect('admin/contents/' . $this->controller_name);
Line 840: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 841: Admin::setCategorySinglecat($this->category_single);
Line 843: $view = new View('sprout/admin/categories_multi_categorise');
Line 878: if (! AdminPerms::controllerAccess($this->getControllerName(), 'edit')) {
Line 880: Url::redirect('admin/contents/' . $this->controller_name);
Line 885: Url::redirect('admin/contents/' . $this->controller_name);
Line 890: Url::redirect('admin/extra/' . $this->controller_name . '/multi_categorise' . '?' . http_build_query($_POST));
Line 901: Url::redirect('admin/contents/' . $this->controller_name);
Line 920: Url::redirect('admin/contents/' . $this->controller_name);

/sprout/Controllers/Admin/HasCategoriesAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 20: use Sprout\Helpers\Admin;
Line 21: use Sprout\Helpers\AdminError;
Line 22: use Sprout\Helpers\AdminPerms;
Line 41: abstract class HasCategoriesAdminController extends ManagedAdminController {
Line 63: * You will need a "show_admin TINYINT UNSIGNED DEFAULT 1" column on the category table.
Line 139: $columns[] = 'categories.show_admin';
Line 143: $_GET['category_type'] = @$_SESSION['admin']['category_type'];
Line 152: $clause = Constants::$category_admin_where[$_GET['category_type']];
Line 155: $_SESSION['admin']['category_type'] = $_GET['category_type'];
Line 190: $view = new View('sprout/admin/categories_navigation');
Line 218: $tools['reorder'] = "<li class=\"reorder\"><a href=\"admin/extra/{$this->controller_name}_category/reorder_categories\">Reorder Categories</a></li>";
Line 334: $_GET['main_mode'] = @$_SESSION['admin'][$this->controller_name]['main_mode'];
Line 336: $_SESSION['admin'][$this->controller_name]['main_mode'] = $_GET['main_mode'];
Line 414: $itemlist->addAction('edit', "SITE/admin/edit/{$this->controller_name}/%%");
Line 419: $itemlist->addAction('Duplicate', "SITE/admin/duplicate/{$this->controller_name}/%%", 'button-grey icon-before icon-add');
Line 422: $itemlist->addAction('Delete', "SITE/admin/delete/{$this->controller_name}/%%", 'button button-red icon-before icon-delete');
Line 436: $outer = new View("sprout/admin/categories_itemlist_outer");
Line 458: $view = new View('sprout/admin/categories_import_options');
Line 467: Admin::setCategoryTablename($cats_table);
Line 468: Admin::setCategorySinglecat($this->category_single);
Line 508: if (!empty($_SESSION['admin']['field_values'])) {
Line 509: $data = $_SESSION['admin']['field_values'];
Line 510: unset($_SESSION['admin']['field_values']);
Line 514: if (!empty($_SESSION['admin']['field_errors'])) {
Line 515: $errors = $_SESSION['admin']['field_errors'];
Line 516: unset($_SESSION['admin']['field_errors']);
Line 519: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 520: Admin::setCategorySinglecat($this->category_single);
Line 543: $view = new View("{$view_dir}/admin/{$this->controller_name}_add");
Line 578: return new AdminError("Invalid id specified - {$single} does not exist");
Line 583: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 584: Admin::setCategorySinglecat($this->category_single);
Line 612: $view = new View("{$view_dir}/admin/{$this->controller_name}_edit");
Line 616: if (!empty($_SESSION['admin']['field_values'])) {
Line 617: $data = array_merge($data, $_SESSION['admin']['field_values']);
Line 618: unset ($_SESSION['admin']['field_values']);
Line 622: if (!empty($_SESSION['admin']['field_errors'])) {
Line 623: $errors = $_SESSION['admin']['field_errors'];
Line 624: unset($_SESSION['admin']['field_errors']);
Line 658: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 659: Admin::setCategorySinglecat($this->category_single);
Line 676: if (!empty($_SESSION['admin']['field_values'])) {
Line 677: $data = array_merge($data, $_SESSION['admin']['field_values']);
Line 678: unset ($_SESSION['admin']['field_values']);
Line 682: if (!empty($_SESSION['admin']['field_errors'])) {
Line 683: $errors = $_SESSION['admin']['field_errors'];
Line 684: unset($_SESSION['admin']['field_errors']);
Line 708: $view = new View("{$view_dir}/admin/{$this->controller_name}_edit");
Line 831: if (! AdminPerms::controllerAccess($this->getControllerName(), 'edit')) {
Line 832: return new AdminError('Access denied');
Line 837: Url::redirect('admin/contents/' . $this->controller_name);
Line 840: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 841: Admin::setCategorySinglecat($this->category_single);
Line 843: $view = new View('sprout/admin/categories_multi_categorise');
Line 878: if (! AdminPerms::controllerAccess($this->getControllerName(), 'edit')) {
Line 880: Url::redirect('admin/contents/' . $this->controller_name);
Line 885: Url::redirect('admin/contents/' . $this->controller_name);
Line 890: Url::redirect('admin/extra/' . $this->controller_name . '/multi_categorise' . '?' . http_build_query($_POST));
Line 901: Url::redirect('admin/contents/' . $this->controller_name);
Line 920: Url::redirect('admin/contents/' . $this->controller_name);

/sprout/Controllers/Admin/ListAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 17: use Sprout\Helpers\Admin;
Line 18: use Sprout\Helpers\AdminAuth;
Line 36: abstract class ListAdminController extends ManagedAdminController {
Line 56: $view = new View('sprout/admin/list_navigation');
Line 61: $view->record_id = (int) Admin::getRecordId();
Line 80: $items[] = "<li class=\"reorder\"><a href=\"admin/call/{$this->controller_name}/reorder\" onclick=\"$.facebox({'ajax':this.href}); return false;\">Reorder</a></li>";
Line 123: $view = new View('sprout/admin/categories_reorder');
Line 137: AdminAuth::checkLogin();
Line 155: Url::redirect("admin/intro/" . $this->controller_name);

/sprout/Controllers/Admin/ListAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 17: use Sprout\Helpers\Admin;
Line 18: use Sprout\Helpers\AdminAuth;
Line 36: abstract class ListAdminController extends ManagedAdminController {
Line 56: $view = new View('sprout/admin/list_navigation');
Line 61: $view->record_id = (int) Admin::getRecordId();
Line 80: $items[] = "<li class=\"reorder\"><a href=\"admin/call/{$this->controller_name}/reorder\" onclick=\"$.facebox({'ajax':this.href}); return false;\">Reorder</a></li>";
Line 123: $view = new View('sprout/admin/categories_reorder');
Line 137: AdminAuth::checkLogin();
Line 155: Url::redirect("admin/intro/" . $this->controller_name);

/sprout/Controllers/Admin/ManagedAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 23: use Sprout\Helpers\AdminAuth;
Line 24: use Sprout\Helpers\AdminError;
Line 25: use Sprout\Helpers\AdminPerms;
Line 49: * This is a generic controller which all controllers which are managed in the admin area should extend.
Line 57: abstract class ManagedAdminController extends Controller {
Line 302: Url::redirect('admin/contents/' . $this->controller_name);
Line 377: $export = new View("sprout/admin/generic_export");
Line 538: if (!empty($_SESSION['admin']['field_values'])) {
Line 539: $data = $_SESSION['admin']['field_values'];
Line 540: unset ($_SESSION['admin']['field_values']);
Line 545: $view = new View("sprout/admin/{$this->controller_name}_import");
Line 547: $view = new View("sprout/admin/generic_import");
Line 574: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 621: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 883: $view = new View("sprout/admin/generic_search");
Line 992: $_GET['main_mode'] = @$_SESSION['admin'][$this->controller_name]['main_mode'];
Line 994: $_SESSION['admin'][$this->controller_name]['main_mode'] = $_GET['main_mode'];
Line 1072: $itemlist->addAction('edit', "SITE/admin/edit/{$this->controller_name}/%%");
Line 1077: $itemlist->addAction('Duplicate', "SITE/admin/duplicate/{$this->controller_name}/%%", 'button-grey icon-before icon-add');
Line 1080: $itemlist->addAction('Delete', "SITE/admin/delete/{$this->controller_name}/%%", 'button button-red icon-before icon-delete');
Line 1094: $outer = new View("sprout/admin/generic_itemlist_outer");
Line 1108: * Builds the HTML for showing the navigation through pages in the admin.
Line 1197: if (!empty($_SESSION['admin']['field_values'])) {
Line 1198: $data = $_SESSION['admin']['field_values'];
Line 1199: unset($_SESSION['admin']['field_values']);
Line 1203: if (!empty($_SESSION['admin']['field_errors'])) {
Line 1204: $errors = $_SESSION['admin']['field_errors'];
Line 1205: unset($_SESSION['admin']['field_errors']);
Line 1218: $view = new View("{$view_dir}/admin/{$this->controller_name}_add");
Line 1304: * These are rendered into HTML using {@see AdminController::renderSubActions}
Line 1376: return new AdminError("Invalid id specified - {$single} does not exist");
Line 1391: $view = new View("{$view_dir}/admin/{$this->controller_name}_edit");
Line 1395: if (!empty($_SESSION['admin']['field_values'])) {
Line 1396: $data = $_SESSION['admin']['field_values'];
Line 1397: unset($_SESSION['admin']['field_values']);
Line 1401: if (!empty($_SESSION['admin']['field_errors'])) {
Line 1402: $errors = $_SESSION['admin']['field_errors'];
Line 1403: unset($_SESSION['admin']['field_errors']);
Line 1448: * These are rendered into HTML using {@see AdminController::renderSubActions}
Line 1451: * url => URL to link to, e.g. "admin/delete/thing/$item_id"
Line 1462: 'url' => 'admin/delete/' . $this->controller_name . '/' . $item_id,
Line 1526: * These are rendered into HTML using {@see AdminController::renderSubActions}
Line 1556: if (!empty($_SESSION['admin']['field_values'])) {
Line 1557: $data = $_SESSION['admin']['field_values'];
Line 1558: unset ($_SESSION['admin']['field_values']);
Line 1562: if (!empty($_SESSION['admin']['field_errors'])) {
Line 1563: $errors = $_SESSION['admin']['field_errors'];
Line 1564: unset($_SESSION['admin']['field_errors']);
Line 1579: $view = new View("{$view_dir}/admin/{$this->controller_name}_edit");
Line 1633: $view = new View("{$this->getModulePath()}/admin/{$this->controller_name}_delete");
Line 1635: $view = new View("sprout/admin/generic_delete");
Line 1672: * These are rendered into HTML using {@see AdminController::renderSubActions}
Line 1681: 'url' => 'admin/edit/' . $this->controller_name . '/' . $item_id,
Line 1758: $tools['import'] = "<li class=\"import\"><a href=\"SITE/admin/import_upload/{$this->controller_name}\">Import {$friendly}</a></li>";
Line 1759: $tools['export'] = "<li class=\"export\"><a href=\"SITE/admin/export/{$this->controller_name}\">Export {$friendly}</a></li>";
Line 1762: $tools['action_log'] = '<li class="action-log"><a href="SITE/admin/contents/action_log?record_table=' . $this->getTableName() . '">View action log</a></li>';
Line 1791: if (! AdminPerms::controllerAccess($this->getControllerName(), 'delete')) {
Line 1792: return new AdminError('Access denied');
Line 1797: Url::redirect('admin/contents/' . $this->controller_name);
Line 1800: $view = new View('sprout/admin/categories_multi_delete');
Line 1815: if (! AdminPerms::controllerAccess($this->getControllerName(), 'delete')) {
Line 1817: Url::redirect('admin/contents/' . $this->controller_name);
Line 1822: Url::redirect('admin/contents/' . $this->controller_name);
Line 1850: Url::redirect('admin/contents/' . $this->controller_name);
Line 1861: if (! AdminPerms::controllerAccess($this->getControllerName(), 'edit')) {
Line 1897: AdminAuth::checkLogin();
Line 1923: AdminAuth::checkLogin();

/sprout/Controllers/Admin/ManagedAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 23: use Sprout\Helpers\AdminAuth;
Line 24: use Sprout\Helpers\AdminError;
Line 25: use Sprout\Helpers\AdminPerms;
Line 49: * This is a generic controller which all controllers which are managed in the admin area should extend.
Line 57: abstract class ManagedAdminController extends Controller {
Line 302: Url::redirect('admin/contents/' . $this->controller_name);
Line 377: $export = new View("sprout/admin/generic_export");
Line 538: if (!empty($_SESSION['admin']['field_values'])) {
Line 539: $data = $_SESSION['admin']['field_values'];
Line 540: unset ($_SESSION['admin']['field_values']);
Line 545: $view = new View("sprout/admin/{$this->controller_name}_import");
Line 547: $view = new View("sprout/admin/generic_import");
Line 574: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 621: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 883: $view = new View("sprout/admin/generic_search");
Line 992: $_GET['main_mode'] = @$_SESSION['admin'][$this->controller_name]['main_mode'];
Line 994: $_SESSION['admin'][$this->controller_name]['main_mode'] = $_GET['main_mode'];
Line 1072: $itemlist->addAction('edit', "SITE/admin/edit/{$this->controller_name}/%%");
Line 1077: $itemlist->addAction('Duplicate', "SITE/admin/duplicate/{$this->controller_name}/%%", 'button-grey icon-before icon-add');
Line 1080: $itemlist->addAction('Delete', "SITE/admin/delete/{$this->controller_name}/%%", 'button button-red icon-before icon-delete');
Line 1094: $outer = new View("sprout/admin/generic_itemlist_outer");
Line 1108: * Builds the HTML for showing the navigation through pages in the admin.
Line 1197: if (!empty($_SESSION['admin']['field_values'])) {
Line 1198: $data = $_SESSION['admin']['field_values'];
Line 1199: unset($_SESSION['admin']['field_values']);
Line 1203: if (!empty($_SESSION['admin']['field_errors'])) {
Line 1204: $errors = $_SESSION['admin']['field_errors'];
Line 1205: unset($_SESSION['admin']['field_errors']);
Line 1218: $view = new View("{$view_dir}/admin/{$this->controller_name}_add");
Line 1304: * These are rendered into HTML using {@see AdminController::renderSubActions}
Line 1376: return new AdminError("Invalid id specified - {$single} does not exist");
Line 1391: $view = new View("{$view_dir}/admin/{$this->controller_name}_edit");
Line 1395: if (!empty($_SESSION['admin']['field_values'])) {
Line 1396: $data = $_SESSION['admin']['field_values'];
Line 1397: unset($_SESSION['admin']['field_values']);
Line 1401: if (!empty($_SESSION['admin']['field_errors'])) {
Line 1402: $errors = $_SESSION['admin']['field_errors'];
Line 1403: unset($_SESSION['admin']['field_errors']);
Line 1448: * These are rendered into HTML using {@see AdminController::renderSubActions}
Line 1451: * url => URL to link to, e.g. "admin/delete/thing/$item_id"
Line 1462: 'url' => 'admin/delete/' . $this->controller_name . '/' . $item_id,
Line 1526: * These are rendered into HTML using {@see AdminController::renderSubActions}
Line 1556: if (!empty($_SESSION['admin']['field_values'])) {
Line 1557: $data = $_SESSION['admin']['field_values'];
Line 1558: unset ($_SESSION['admin']['field_values']);
Line 1562: if (!empty($_SESSION['admin']['field_errors'])) {
Line 1563: $errors = $_SESSION['admin']['field_errors'];
Line 1564: unset($_SESSION['admin']['field_errors']);
Line 1579: $view = new View("{$view_dir}/admin/{$this->controller_name}_edit");
Line 1633: $view = new View("{$this->getModulePath()}/admin/{$this->controller_name}_delete");
Line 1635: $view = new View("sprout/admin/generic_delete");
Line 1672: * These are rendered into HTML using {@see AdminController::renderSubActions}
Line 1681: 'url' => 'admin/edit/' . $this->controller_name . '/' . $item_id,
Line 1758: $tools['import'] = "<li class=\"import\"><a href=\"SITE/admin/import_upload/{$this->controller_name}\">Import {$friendly}</a></li>";
Line 1759: $tools['export'] = "<li class=\"export\"><a href=\"SITE/admin/export/{$this->controller_name}\">Export {$friendly}</a></li>";
Line 1762: $tools['action_log'] = '<li class="action-log"><a href="SITE/admin/contents/action_log?record_table=' . $this->getTableName() . '">View action log</a></li>';
Line 1791: if (! AdminPerms::controllerAccess($this->getControllerName(), 'delete')) {
Line 1792: return new AdminError('Access denied');
Line 1797: Url::redirect('admin/contents/' . $this->controller_name);
Line 1800: $view = new View('sprout/admin/categories_multi_delete');
Line 1815: if (! AdminPerms::controllerAccess($this->getControllerName(), 'delete')) {
Line 1817: Url::redirect('admin/contents/' . $this->controller_name);
Line 1822: Url::redirect('admin/contents/' . $this->controller_name);
Line 1850: Url::redirect('admin/contents/' . $this->controller_name);
Line 1861: if (! AdminPerms::controllerAccess($this->getControllerName(), 'edit')) {
Line 1897: AdminAuth::checkLogin();
Line 1923: AdminAuth::checkLogin();

/sprout/Controllers/Admin/MySettingsAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 18: use Sprout\Helpers\AdminAuth;
Line 33: class MySettingsAdminController extends NoRecordsAdminController
Line 41: Url::redirect('admin/extra/my_settings/details');
Line 52: $tools[] = '<li><a href="admin/extra/my_settings/details">Details and password</a></li>';
Line 53: $tools[] = '<li><a href="admin/extra/my_settings/twoFactor">Setup two-factor auth</a></li>';
Line 63: $view = new View('sprout/admin/my_settings/details');
Line 65: $data = Form::loadFromSession('admin_my_settings');
Line 67: Form::setData(AdminAuth::getDetails());
Line 82: $_SESSION['admin_my_settings']['field_values'] = Validator::trim($_POST);
Line 93: $result = AdminAuth::checkPassword($_POST['old_password'], AdminAuth::getId());
Line 111: $_SESSION['admin_my_settings']['field_errors'] = $valid->getFieldErrors();
Line 112: Url::redirect('admin/extra/my_settings/details');
Line 121: Pdb::update('operators', $data, ['id' => AdminAuth::getId()]);
Line 124: AdminAuth::changePassword($_POST['password1'], AdminAuth::getId());
Line 129: unset($_SESSION['admin_my_settings']);
Line 131: Url::redirect('admin/extra/my_settings/details');
Line 141: $operator = Pdb::query($q, [AdminAuth::getLocalId()], 'row');
Line 150: $issuer = Kohana::config('sprout.site_title') . ' admin';
Line 157: $view->action_url = 'admin/call/my_settings/tfaTotpSetupAction';
Line 163: $view->action_url = 'admin/call/my_settings/tfaDisableAction';
Line 184: Url::redirect('admin/extra/my_settings/twoFactor');
Line 190: Pdb::update('operators', $data, ['id' => AdminAuth::getLocalId()]);
Line 194: Url::redirect('admin/extra/my_settings/twoFactor');
Line 206: Pdb::update('operators', $data, ['id' => AdminAuth::getLocalId()]);
Line 209: Url::redirect('admin/extra/my_settings/twoFactor');

/sprout/Controllers/Admin/MySettingsAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 18: use Sprout\Helpers\AdminAuth;
Line 33: class MySettingsAdminController extends NoRecordsAdminController
Line 41: Url::redirect('admin/extra/my_settings/details');
Line 52: $tools[] = '<li><a href="admin/extra/my_settings/details">Details and password</a></li>';
Line 53: $tools[] = '<li><a href="admin/extra/my_settings/twoFactor">Setup two-factor auth</a></li>';
Line 63: $view = new View('sprout/admin/my_settings/details');
Line 65: $data = Form::loadFromSession('admin_my_settings');
Line 67: Form::setData(AdminAuth::getDetails());
Line 82: $_SESSION['admin_my_settings']['field_values'] = Validator::trim($_POST);
Line 93: $result = AdminAuth::checkPassword($_POST['old_password'], AdminAuth::getId());
Line 111: $_SESSION['admin_my_settings']['field_errors'] = $valid->getFieldErrors();
Line 112: Url::redirect('admin/extra/my_settings/details');
Line 121: Pdb::update('operators', $data, ['id' => AdminAuth::getId()]);
Line 124: AdminAuth::changePassword($_POST['password1'], AdminAuth::getId());
Line 129: unset($_SESSION['admin_my_settings']);
Line 131: Url::redirect('admin/extra/my_settings/details');
Line 141: $operator = Pdb::query($q, [AdminAuth::getLocalId()], 'row');
Line 150: $issuer = Kohana::config('sprout.site_title') . ' admin';
Line 157: $view->action_url = 'admin/call/my_settings/tfaTotpSetupAction';
Line 163: $view->action_url = 'admin/call/my_settings/tfaDisableAction';
Line 184: Url::redirect('admin/extra/my_settings/twoFactor');
Line 190: Pdb::update('operators', $data, ['id' => AdminAuth::getLocalId()]);
Line 194: Url::redirect('admin/extra/my_settings/twoFactor');
Line 206: Pdb::update('operators', $data, ['id' => AdminAuth::getLocalId()]);
Line 209: Url::redirect('admin/extra/my_settings/twoFactor');

/sprout/Controllers/Admin/NoRecordsAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 20: abstract class NoRecordsAdminController extends ManagedAdminController

/sprout/Controllers/Admin/NoRecordsAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 20: abstract class NoRecordsAdminController extends ManagedAdminController

/sprout/Controllers/Admin/OperatorAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 18: use Sprout\Helpers\AdminAuth;
Line 19: use Sprout\Helpers\AdminError;
Line 20: use Sprout\Helpers\AdminPerms;
Line 33: class OperatorAdminController extends HasCategoriesAdminController
Line 63: $this->manage_cats = AdminPerms::getManageOperatorCategories();
Line 65: if (!AdminPerms::canAccess('access_operators')) {
Line 79: if (! AdminPerms::canAccess('access_operators')) return array();
Line 83: $tools[] = '<li class="config"><a href="' . EmailText::adminEditUrl('operator.welcome') . '">Edit welcome message email</a></li>';
Line 95: return new AdminError('Access denied');
Line 108: return new AdminError('Access denied');
Line 116: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 132: if (!AdminPerms::canEditOperator($item_id) and $item_id != AdminAuth::getId()) {
Line 133: return new AdminError('Access denied');
Line 145: if (!AdminPerms::canEditOperator($item_id)) {
Line 146: return new AdminError('Access denied');
Line 149: if ($item_id == AdminAuth::getLocalId()) {
Line 150: return new AdminError('You cannot delete your own record');
Line 179: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 195: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 203: $_SESSION['admin']['field_errors']['password1'] = 'Not complex enough';
Line 204: $_SESSION['admin']['field_errors']['password2'] = 'Not complex enough';
Line 247: AdminAuth::changePassword($_POST['password1'], $item_id);
Line 277: if (AdminAuth::hasDatabaseRecord() and $item_id == AdminAuth::getId()) {
Line 278: Url::redirect('admin/intro/my_settings');
Line 286: Url::redirect('admin/intro/operator');
Line 302: if (AdminAuth::hasDatabaseRecord() and $item_id == AdminAuth::getId()) {
Line 303: Url::redirect('admin/intro/my_settings');
Line 306: $can_access = AdminPerms::canEditOperator($item_id);
Line 309: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 324: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 333: $_SESSION['admin']['field_errors']['password1'] = 'Not complex enough';
Line 334: $_SESSION['admin']['field_errors']['password2'] = 'Not complex enough';
Line 377: AdminAuth::changePassword($_POST['password1'], $item_id);
Line 401: if (!AdminPerms::canEditOperator($item_id)) {
Line 405: if ($item_id == AdminAuth::getLocalId()) {

/sprout/Controllers/Admin/OperatorAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 18: use Sprout\Helpers\AdminAuth;
Line 19: use Sprout\Helpers\AdminError;
Line 20: use Sprout\Helpers\AdminPerms;
Line 33: class OperatorAdminController extends HasCategoriesAdminController
Line 63: $this->manage_cats = AdminPerms::getManageOperatorCategories();
Line 65: if (!AdminPerms::canAccess('access_operators')) {
Line 79: if (! AdminPerms::canAccess('access_operators')) return array();
Line 83: $tools[] = '<li class="config"><a href="' . EmailText::adminEditUrl('operator.welcome') . '">Edit welcome message email</a></li>';
Line 95: return new AdminError('Access denied');
Line 108: return new AdminError('Access denied');
Line 116: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 132: if (!AdminPerms::canEditOperator($item_id) and $item_id != AdminAuth::getId()) {
Line 133: return new AdminError('Access denied');
Line 145: if (!AdminPerms::canEditOperator($item_id)) {
Line 146: return new AdminError('Access denied');
Line 149: if ($item_id == AdminAuth::getLocalId()) {
Line 150: return new AdminError('You cannot delete your own record');
Line 179: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 195: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 203: $_SESSION['admin']['field_errors']['password1'] = 'Not complex enough';
Line 204: $_SESSION['admin']['field_errors']['password2'] = 'Not complex enough';
Line 247: AdminAuth::changePassword($_POST['password1'], $item_id);
Line 277: if (AdminAuth::hasDatabaseRecord() and $item_id == AdminAuth::getId()) {
Line 278: Url::redirect('admin/intro/my_settings');
Line 286: Url::redirect('admin/intro/operator');
Line 302: if (AdminAuth::hasDatabaseRecord() and $item_id == AdminAuth::getId()) {
Line 303: Url::redirect('admin/intro/my_settings');
Line 306: $can_access = AdminPerms::canEditOperator($item_id);
Line 309: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 324: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 333: $_SESSION['admin']['field_errors']['password1'] = 'Not complex enough';
Line 334: $_SESSION['admin']['field_errors']['password2'] = 'Not complex enough';
Line 377: AdminAuth::changePassword($_POST['password1'], $item_id);
Line 401: if (!AdminPerms::canEditOperator($item_id)) {
Line 405: if ($item_id == AdminAuth::getLocalId()) {

/sprout/Controllers/Admin/OperatorCategoryAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 17: use Sprout\Helpers\AdminError;
Line 18: use Sprout\Helpers\AdminPerms;
Line 29: class OperatorCategoryAdminController extends CategoryAdminController
Line 37: protected $edit_view_name = 'sprout/admin/operator_category_edit';
Line 42: if (! AdminPerms::canAccess('access_operators')) return new AdminError('Access denied');
Line 48: if (! AdminPerms::canAccess('access_operators')) return new AdminError('Access denied');
Line 54: if (! AdminPerms::canAccess('access_operators')) return new AdminError('Access denied');
Line 63: $controllers = Register::getAdminControllers();
Line 68: if ($reflect->isSubclassOf('Sprout\\Controllers\\Admin\\CategoryAdminController')) {
Line 119: if (! AdminPerms::canAccess('access_operators')) return false;
Line 121: unset($_SESSION['admin']['field_errors']);
Line 122: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 144: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();

/sprout/Controllers/Admin/OperatorCategoryAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 17: use Sprout\Helpers\AdminError;
Line 18: use Sprout\Helpers\AdminPerms;
Line 29: class OperatorCategoryAdminController extends CategoryAdminController
Line 37: protected $edit_view_name = 'sprout/admin/operator_category_edit';
Line 42: if (! AdminPerms::canAccess('access_operators')) return new AdminError('Access denied');
Line 48: if (! AdminPerms::canAccess('access_operators')) return new AdminError('Access denied');
Line 54: if (! AdminPerms::canAccess('access_operators')) return new AdminError('Access denied');
Line 63: $controllers = Register::getAdminControllers();
Line 68: if ($reflect->isSubclassOf('Sprout\\Controllers\\Admin\\CategoryAdminController')) {
Line 119: if (! AdminPerms::canAccess('access_operators')) return false;
Line 121: unset($_SESSION['admin']['field_errors']);
Line 122: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 144: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 26: use Sprout\Helpers\Admin;
Line 27: use Sprout\Helpers\AdminAuth;
Line 28: use Sprout\Helpers\AdminError;
Line 29: use Sprout\Helpers\AdminPerms;
Line 30: use Sprout\Helpers\AdminSeo;
Line 75: * Handles admin processing for pages
Line 77: class PageAdminController extends TreeAdminController
Line 157: if (!empty($_SESSION['admin'][$this->controller_name . '_nav'])) {
Line 158: $nodes_string = "'" . implode ("', '", $_SESSION['admin'][$this->controller_name . '_nav']) . "'";
Line 163: $view = new View('sprout/admin/page_navigation');
Line 164: $view->home_page_id = Pdb::q($q, [$_SESSION['admin']['active_subsite']], 'val');
Line 168: $view->record_id = Admin::getRecordId();
Line 177: $view = new View('sprout/admin/page_add_save');
Line 183: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 193: 'url' => 'admin/add/page',
Line 198: 'url' => 'admin/add/page?type=tool',
Line 218: 'admin_perm_type' => Constants::PERM_INHERIT,
Line 221: 'admin_perm_specific' => 0,
Line 222: 'admin_permissions' => [],
Line 227: if (! AdminPerms::canAccess('access_noapproval')) {
Line 232: if (!empty($_SESSION['admin']['field_values'])) {
Line 233: $data = $_SESSION['admin']['field_values'];
Line 234: unset ($_SESSION['admin']['field_values']);
Line 238: if (!empty($_SESSION['admin']['field_errors'])) {
Line 239: $errors = $_SESSION['admin']['field_errors'];
Line 240: unset($_SESSION['admin']['field_errors']);
Line 243: $templates = Subsites::getConfigAdmin('skin_views');
Line 269: $view = new View('sprout/admin/page_add');
Line 273: $view->admin_category_options = AdminAuth::getAllCategories();
Line 294: $_POST['admin_perm_specific'] = (empty($_POST['admin_perm_specific']) ? 0 : 1);
Line 309: 'subsite_id' => $_SESSION['admin']['active_subsite'],
Line 325: // Tell core AdminController the right URL to redirect to upon validation error
Line 326: $_POST['current_url'] = 'admin/add/page?type=tool';
Line 330: $_SESSION['admin']['field_values'] = $_POST;
Line 331: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 340: $operator = AdminAuth::getDetails();
Line 354: $update_fields['subsite_id'] = $_SESSION['admin']['active_subsite'];
Line 361: if ($_POST['admin_perm_specific'] == 1) {
Line 362: $update_fields['admin_perm_type'] = Constants::PERM_SPECIFIC;
Line 364: $update_fields['admin_perm_type'] = Constants::PERM_INHERIT;
Line 405: // Admin permissions
Line 406: if ($_POST['admin_perm_specific'] == 1 and @count($_POST['admin_permissions'])) {
Line 407: foreach ($_POST['admin_permissions'] as $id) {
Line 416: Pdb::insert('page_admin_permissions', $update_fields);
Line 444: return 'admin/edit/' . $this->controller_name . '/' . $page_id . '?suppress=true';
Line 463: $view = new View('sprout/admin/page_import_upload');
Line 475: AdminAuth::checkLogin();
Line 562: Url::redirect("admin/import_upload/page");
Line 565: Url::redirect("admin/import_options/page?timestamp={$timestamp}&ext=xml");
Line 574: AdminAuth::checkLogin();
Line 635: $view = new View('sprout/admin/page_import_options');
Line 649: AdminAuth::checkLogin();
Line 669: $operator = AdminAuth::getDetails();
Line 797: $update_fields['subsite_id'] = $_SESSION['admin']['active_subsite'];
Line 851: $user_id = AdminAuth::getId();
Line 859: $approval_admins = Pdb::q($q, [$user_id], 'map');
Line 861: $view = new View('sprout/admin/page_edit_save');
Line 863: $view->preview_url = Subsites::getAbsRootAdmin() . 'admin/call/page/preview/' . $item_id;
Line 864: $view->approval_admins = $approval_admins;
Line 899: $subsite = Pdb::q($q, [$_SESSION['admin']['active_subsite']], 'row');
Line 901: return new AdminError("Invalid id specified - current subsite does not exist");
Line 909: return new AdminError("Invalid id specified - page does not exist");
Line 918: $res = AdminPerms::checkPermissionsTree('pages', $id);
Line 919: if (! $res) return new AdminError("Access denied to modify this page");
Line 928: return new AdminError("Invalid id specified - page does not have any revisions");
Line 937: if (!empty($_SESSION['admin']['field_values']['rev_id'])) {
Line 939: if ($rev['id'] == $_SESSION['admin']['field_values']['rev_id']) {
Line 990: if (AdminPerms::canAccess('access_noapproval')) {
Line 1026: AdminSeo::setTopic($page['name']);
Line 1027: AdminSeo::setSlug($data['slug']);
Line 1028: AdminSeo::addContent($text);
Line 1029: AdminSeo::addLinks(Page::determineRelatedLinks($id));
Line 1035: return new AdminError("Invalid page type");
Line 1039: $admin_permissions = AdminPerms::getAccessableGroups('pages', $id);
Line 1040: if ($data['admin_perm_type'] == Constants::PERM_SPECIFIC) {
Line 1041: $data['admin_perm_specific'] = 1;
Line 1043: $data['admin_perm_specific'] = 0;
Line 1046: $data['admin_permissions'] = $admin_permissions;
Line 1059: if (!empty($_SESSION['admin']['field_values'])) {
Line 1060: $data = array_merge($data, $_SESSION['admin']['field_values']);
Line 1061: unset ($_SESSION['admin']['field_values']);
Line 1088: $templates = Subsites::getConfigAdmin('skin_views');
Line 1098: // Load admin notes, if found
Line 1099: $admin_notes = null;
Line 1101: if ($row['name'] == 'sprout.admin_notes') {
Line 1102: $admin_notes = trim($row['value']);
Line 1108: if (!$admin_notes and $data['type'] == 'redirect') {
Line 1112: $admin_notes = 'This page redirects to an ' . $typename . '. Content blocks on this page have been disabled.';
Line 1114: $admin_notes = 'This page redirects to a ' . $typename . '. Content blocks on this page have been disabled.';
Line 1117: $admin_notes = 'This page will redirect. Content blocks on this page have been disabled.';
Line 1122: $richtext_width = Kohana::config('sprout.admin_richtext_width');
Line 1123: $richtext_height = Kohana::config('sprout.admin_richtext_height');
Line 1128: $view = new View('sprout/admin/page_edit');
Line 1131: if (!empty($_SESSION['admin']['field_errors'])) {
Line 1132: $errors = $_SESSION['admin']['field_errors'];
Line 1133: unset($_SESSION['admin']['field_errors']);
Line 1143: $view->admin_category_options = AdminAuth::getAllCategories();
Line 1144: $view->admin_permissions = $admin_permissions;
Line 1147: $view->can_approve_revisions = AdminPerms::canAccess('access_noapproval');
Line 1151: $view->admin_notes = $admin_notes;
Line 1164: $view->show_tour = !Admin::isTourCompleted('page_edit');
Line 1228: AdminAuth::checkLogin();
Line 1238: $root = Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true);
Line 1245: $groups = NavigationGroups::getGroupsAdmin($top_parent['id']);
Line 1273: $res = AdminPerms::checkPermissionsTree('pages', $page_id);
Line 1442: 'subsite_id' => $_SESSION['admin']['active_subsite'],
Line 1495: $root_node = Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true);
Line 1510: $_SESSION['admin']['field_values'] = $_POST;
Line 1511: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 1516: $operator = AdminAuth::getDetails();
Line 1561: if (@$_POST['admin_perm_specific'] == 1) {
Line 1562: $update_fields['admin_perm_type'] = Constants::PERM_SPECIFIC;
Line 1564: $update_fields['admin_perm_type'] = Constants::PERM_INHERIT;
Line 1667: // Admin permissions
Line 1668: Pdb::delete('page_admin_permissions', ['item_id' => $page_id]);
Line 1670: if (@$_POST['admin_perm_specific'] == 1 and @count($_POST['admin_permissions'])) {
Line 1671: foreach ($_POST['admin_permissions'] as $id) {
Line 1680: Pdb::insert('page_admin_permissions', $update_fields);
Line 1723: $text = Page::getText($page_id, $rev_id, $_SESSION['admin']['active_subsite']);
Line 1783: return "admin/edit/page/{$page_id}?revision={$rev_id}";
Line 1796: $view = new View('sprout/admin/tree_organise');
Line 1813: $view = new View('sprout/admin/page_menu_groups');
Line 1814: $view->all_groups = NavigationGroups::getAllGroupsAdmin();
Line 1815: $view->all_extras = NavigationGroups::getAllExtrasAdmin();
Line 1817: $enabled_extras = Subsites::getConfigAdmin('nav_extras');
Line 1835: AdminAuth::checkLogin();
Line 1838: $enabled_extras = Subsites::getConfigAdmin('nav_extras');
Line 1843: $all_groups = NavigationGroups::getAllGroupsAdmin();
Line 1851: $conditions['subsite_id'] = (int)$_SESSION['admin']['active_subsite'];
Line 1860: $update_data['subsite_id'] = (int)$_SESSION['admin']['active_subsite'];
Line 1884: Url::redirect('admin/extra/page/menu_groups');
Line 1894: $operator = AdminAuth::getDetails();
Line 1921: $view = new View('sprout/admin/page_delete');
Line 1929: return new AdminError("Invalid id specified - page does not exist");
Line 1933: $res = AdminPerms::checkPermissionsTree('pages', $id);
Line 1934: if (! $res) return new AdminError("Access denied to delete this page");
Line 1963: if (!AdminPerms::checkPermissionsTree('pages', $item_id)) {
Line 1987: $res = AdminPerms::checkPermissionsTree('pages', $id);
Line 1990: $view = new View('sprout/admin/page_linklist');
Line 2031: $list->addAction('edit', "SITE/admin/edit/{$this->controller_name}/%%");
Line 2064: * Looks for a view named "admin/<controller-name>_intro", and loads it if found.
Line 2065: * Otherwise, loads the view, "admin/generic_intro".
Line 2069: $intro = new View("sprout/admin/page_intro");
Line 2081: $res = Pdb::q($q, [$_SESSION['admin']['active_subsite']], 'arr');
Line 2087: $itemlist->addAction('edit', "SITE/admin/edit/{$this->controller_name}/%%");
Line 2093: if (AdminPerms::canAccess('access_noapproval')) {
Line 2102: $res = Pdb::q($q, ['need_approval', $_SESSION['admin']['active_subsite']], 'arr');
Line 2112: $itemlist->addAction('edit', 'SITE/admin/edit/page/%%#main-tabs-revs');
Line 2149: AdminAuth::checkLogin();
Line 2220: AdminAuth::checkLogin();
Line 2225: Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true);
Line 2230: $nav_limit = Subsites::getConfigAdmin('nav_limit');
Line 2232: if (Subsites::getConfigAdmin('nav_home')) $nav_limit--;
Line 2247: $admin_perms = AdminPerms::checkPermissionsTree('pages', $top_node['id']);
Line 2249: $class = ($admin_perms ? ' allow-access' : ' no-access');
Line 2262: $admin_perms = AdminPerms::checkPermissionsTree('pages', $child['id']);
Line 2264: $class = ($admin_perms ? ' allow-access' : ' no-access');
Line 2265: if (count($child->children) > 0 and $admin_perms) {
Line 2284: echo "&#43; <a href=\"SITE/admin/add/page?parent_id={$top_node['id']}\">Add Child</a>";
Line 2290: if ($_SESSION['admin'][$this->controller_name . '_nav'] == null) $_SESSION['admin'][$this->controller_name . '_nav'] = array();
Line 2291: if ($_POST['dir'] != '/' and !in_array ($_POST['dir'], $_SESSION['admin'][$this->controller_name . '_nav'])) {
Line 2292: $_SESSION['admin'][$this->controller_name . '_nav'][] = $_POST['dir'];
Line 2302: AdminAuth::checkLogin();
Line 2304: if (empty($_SESSION['admin'][$this->controller_name . '_nav'])) return;
Line 2306: $index = array_search ($_POST['dir'], $_SESSION['admin'][$this->controller_name . '_nav']);
Line 2307: unset ($_SESSION['admin'][$this->controller_name . '_nav'][$index]);
Line 2317: AdminAuth::checkLogin();
Line 2324: $children = Pdb::q($q, [$_SESSION['admin']['active_subsite']], 'arr');
Line 2333: $view = new View('sprout/admin/categories_reorder');
Line 2462: $items[] = "<li class=\"import\"><a href=\"SITE/admin/import_upload/page\">Document import</a></li>";
Line 2465: $items[] = "<li class=\"action-log\"><a href=\"SITE/admin/search/{$this->controller_name}\">Search pages</a></li>";
Line 2467: if (AdminPerms::canAccess('access_noapproval')) {
Line 2468: $items[] = "<li class=\"action-log\"><a href=\"admin/extra/page/need_approval\">Pages needing approval</a></li>";
Line 2471: if (AdminAuth::isSuper() or Subsites::getConfigAdmin('nav_reorder')) {
Line 2473: $items[] = "<li class=\"reorder\"><a href=\"admin/call/{$this->controller_name}/reorderTop\" onclick=\"$.facebox({'ajax':this.href}); return false;\">Reorder top-level</a></li>";
Line 2476: if (AdminAuth::isSuper()) {
Line 2477: $items[] = "<li class=\"config\"><a href=\"admin/extra/page/organise\">Sitemap manager</a></li>";
Line 2480: if (Subsites::getConfigAdmin('nav_groups') !== null) {
Line 2481: $items[] = "<li class=\"config\"><a href=\"admin/extra/page/menu_groups\">Manage menu groups</a></li>";
Line 2484: $items[] = "<li class=\"config\"><a href=\"admin/extra/page/link_checker\">Link checker</a></li>";
Line 2491: $tools[] = '<li class="action-log"><a href="SITE/admin/contents/action_log?record_table=' . $this->getTableName() . '">View action log</a></li>';
Line 2503: $view = new View('sprout/admin/link_checker');
Line 2504: $view->ops = AdminPerms::getOperatorsWithAccess('access_reportemail');
Line 2506: $details = AdminAuth::getDetails();
Line 2521: AdminAuth::checkLogin();
Line 2527: if ($_POST['send_to'] != 'admins' and $_POST['send_to'] != 'specific') {
Line 2529: Url::redirect('admin/extra/page/link_checker');
Line 2534: Url::redirect('admin/extra/page/link_checker');
Line 2538: if ($_POST['send_to'] == 'admins') {
Line 2545: Url::redirect('admin/extra/page/link_checker');
Line 2549: Url::redirect('admin/extra/page/link_checker_info/' . $info['job_id']);
Line 2577: if (!AdminPerms::canAccess('access_noapproval')) {
Line 2589: $res = Pdb::query($q, [$_SESSION['admin']['active_subsite']], 'arr');
Line 2598: $itemlist->addAction('edit', 'admin/edit/page/%%');
Line 2734: AdminAuth::checkLogin();
Line 2739: Url::redirect('admin/intro/page');
Line 2751: 'page_admin_permissions' => 1,
Line 2759: // be saved under a different status once the current administrator is happy with the preview

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 26: use Sprout\Helpers\Admin;
Line 27: use Sprout\Helpers\AdminAuth;
Line 28: use Sprout\Helpers\AdminError;
Line 29: use Sprout\Helpers\AdminPerms;
Line 30: use Sprout\Helpers\AdminSeo;
Line 75: * Handles admin processing for pages
Line 77: class PageAdminController extends TreeAdminController
Line 157: if (!empty($_SESSION['admin'][$this->controller_name . '_nav'])) {
Line 158: $nodes_string = "'" . implode ("', '", $_SESSION['admin'][$this->controller_name . '_nav']) . "'";
Line 163: $view = new View('sprout/admin/page_navigation');
Line 164: $view->home_page_id = Pdb::q($q, [$_SESSION['admin']['active_subsite']], 'val');
Line 168: $view->record_id = Admin::getRecordId();
Line 177: $view = new View('sprout/admin/page_add_save');
Line 183: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 193: 'url' => 'admin/add/page',
Line 198: 'url' => 'admin/add/page?type=tool',
Line 218: 'admin_perm_type' => Constants::PERM_INHERIT,
Line 221: 'admin_perm_specific' => 0,
Line 222: 'admin_permissions' => [],
Line 227: if (! AdminPerms::canAccess('access_noapproval')) {
Line 232: if (!empty($_SESSION['admin']['field_values'])) {
Line 233: $data = $_SESSION['admin']['field_values'];
Line 234: unset ($_SESSION['admin']['field_values']);
Line 238: if (!empty($_SESSION['admin']['field_errors'])) {
Line 239: $errors = $_SESSION['admin']['field_errors'];
Line 240: unset($_SESSION['admin']['field_errors']);
Line 243: $templates = Subsites::getConfigAdmin('skin_views');
Line 269: $view = new View('sprout/admin/page_add');
Line 273: $view->admin_category_options = AdminAuth::getAllCategories();
Line 294: $_POST['admin_perm_specific'] = (empty($_POST['admin_perm_specific']) ? 0 : 1);
Line 309: 'subsite_id' => $_SESSION['admin']['active_subsite'],
Line 325: // Tell core AdminController the right URL to redirect to upon validation error
Line 326: $_POST['current_url'] = 'admin/add/page?type=tool';
Line 330: $_SESSION['admin']['field_values'] = $_POST;
Line 331: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 340: $operator = AdminAuth::getDetails();
Line 354: $update_fields['subsite_id'] = $_SESSION['admin']['active_subsite'];
Line 361: if ($_POST['admin_perm_specific'] == 1) {
Line 362: $update_fields['admin_perm_type'] = Constants::PERM_SPECIFIC;
Line 364: $update_fields['admin_perm_type'] = Constants::PERM_INHERIT;
Line 405: // Admin permissions
Line 406: if ($_POST['admin_perm_specific'] == 1 and @count($_POST['admin_permissions'])) {
Line 407: foreach ($_POST['admin_permissions'] as $id) {
Line 416: Pdb::insert('page_admin_permissions', $update_fields);
Line 444: return 'admin/edit/' . $this->controller_name . '/' . $page_id . '?suppress=true';
Line 463: $view = new View('sprout/admin/page_import_upload');
Line 475: AdminAuth::checkLogin();
Line 562: Url::redirect("admin/import_upload/page");
Line 565: Url::redirect("admin/import_options/page?timestamp={$timestamp}&ext=xml");
Line 574: AdminAuth::checkLogin();
Line 635: $view = new View('sprout/admin/page_import_options');
Line 649: AdminAuth::checkLogin();
Line 669: $operator = AdminAuth::getDetails();
Line 797: $update_fields['subsite_id'] = $_SESSION['admin']['active_subsite'];
Line 851: $user_id = AdminAuth::getId();
Line 859: $approval_admins = Pdb::q($q, [$user_id], 'map');
Line 861: $view = new View('sprout/admin/page_edit_save');
Line 863: $view->preview_url = Subsites::getAbsRootAdmin() . 'admin/call/page/preview/' . $item_id;
Line 864: $view->approval_admins = $approval_admins;
Line 899: $subsite = Pdb::q($q, [$_SESSION['admin']['active_subsite']], 'row');
Line 901: return new AdminError("Invalid id specified - current subsite does not exist");
Line 909: return new AdminError("Invalid id specified - page does not exist");
Line 918: $res = AdminPerms::checkPermissionsTree('pages', $id);
Line 919: if (! $res) return new AdminError("Access denied to modify this page");
Line 928: return new AdminError("Invalid id specified - page does not have any revisions");
Line 937: if (!empty($_SESSION['admin']['field_values']['rev_id'])) {
Line 939: if ($rev['id'] == $_SESSION['admin']['field_values']['rev_id']) {
Line 990: if (AdminPerms::canAccess('access_noapproval')) {
Line 1026: AdminSeo::setTopic($page['name']);
Line 1027: AdminSeo::setSlug($data['slug']);
Line 1028: AdminSeo::addContent($text);
Line 1029: AdminSeo::addLinks(Page::determineRelatedLinks($id));
Line 1035: return new AdminError("Invalid page type");
Line 1039: $admin_permissions = AdminPerms::getAccessableGroups('pages', $id);
Line 1040: if ($data['admin_perm_type'] == Constants::PERM_SPECIFIC) {
Line 1041: $data['admin_perm_specific'] = 1;
Line 1043: $data['admin_perm_specific'] = 0;
Line 1046: $data['admin_permissions'] = $admin_permissions;
Line 1059: if (!empty($_SESSION['admin']['field_values'])) {
Line 1060: $data = array_merge($data, $_SESSION['admin']['field_values']);
Line 1061: unset ($_SESSION['admin']['field_values']);
Line 1088: $templates = Subsites::getConfigAdmin('skin_views');
Line 1098: // Load admin notes, if found
Line 1099: $admin_notes = null;
Line 1101: if ($row['name'] == 'sprout.admin_notes') {
Line 1102: $admin_notes = trim($row['value']);
Line 1108: if (!$admin_notes and $data['type'] == 'redirect') {
Line 1112: $admin_notes = 'This page redirects to an ' . $typename . '. Content blocks on this page have been disabled.';
Line 1114: $admin_notes = 'This page redirects to a ' . $typename . '. Content blocks on this page have been disabled.';
Line 1117: $admin_notes = 'This page will redirect. Content blocks on this page have been disabled.';
Line 1122: $richtext_width = Kohana::config('sprout.admin_richtext_width');
Line 1123: $richtext_height = Kohana::config('sprout.admin_richtext_height');
Line 1128: $view = new View('sprout/admin/page_edit');
Line 1131: if (!empty($_SESSION['admin']['field_errors'])) {
Line 1132: $errors = $_SESSION['admin']['field_errors'];
Line 1133: unset($_SESSION['admin']['field_errors']);
Line 1143: $view->admin_category_options = AdminAuth::getAllCategories();
Line 1144: $view->admin_permissions = $admin_permissions;
Line 1147: $view->can_approve_revisions = AdminPerms::canAccess('access_noapproval');
Line 1151: $view->admin_notes = $admin_notes;
Line 1164: $view->show_tour = !Admin::isTourCompleted('page_edit');
Line 1228: AdminAuth::checkLogin();
Line 1238: $root = Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true);
Line 1245: $groups = NavigationGroups::getGroupsAdmin($top_parent['id']);
Line 1273: $res = AdminPerms::checkPermissionsTree('pages', $page_id);
Line 1442: 'subsite_id' => $_SESSION['admin']['active_subsite'],
Line 1495: $root_node = Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true);
Line 1510: $_SESSION['admin']['field_values'] = $_POST;
Line 1511: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 1516: $operator = AdminAuth::getDetails();
Line 1561: if (@$_POST['admin_perm_specific'] == 1) {
Line 1562: $update_fields['admin_perm_type'] = Constants::PERM_SPECIFIC;
Line 1564: $update_fields['admin_perm_type'] = Constants::PERM_INHERIT;
Line 1667: // Admin permissions
Line 1668: Pdb::delete('page_admin_permissions', ['item_id' => $page_id]);
Line 1670: if (@$_POST['admin_perm_specific'] == 1 and @count($_POST['admin_permissions'])) {
Line 1671: foreach ($_POST['admin_permissions'] as $id) {
Line 1680: Pdb::insert('page_admin_permissions', $update_fields);
Line 1723: $text = Page::getText($page_id, $rev_id, $_SESSION['admin']['active_subsite']);
Line 1783: return "admin/edit/page/{$page_id}?revision={$rev_id}";
Line 1796: $view = new View('sprout/admin/tree_organise');
Line 1813: $view = new View('sprout/admin/page_menu_groups');
Line 1814: $view->all_groups = NavigationGroups::getAllGroupsAdmin();
Line 1815: $view->all_extras = NavigationGroups::getAllExtrasAdmin();
Line 1817: $enabled_extras = Subsites::getConfigAdmin('nav_extras');
Line 1835: AdminAuth::checkLogin();
Line 1838: $enabled_extras = Subsites::getConfigAdmin('nav_extras');
Line 1843: $all_groups = NavigationGroups::getAllGroupsAdmin();
Line 1851: $conditions['subsite_id'] = (int)$_SESSION['admin']['active_subsite'];
Line 1860: $update_data['subsite_id'] = (int)$_SESSION['admin']['active_subsite'];
Line 1884: Url::redirect('admin/extra/page/menu_groups');
Line 1894: $operator = AdminAuth::getDetails();
Line 1921: $view = new View('sprout/admin/page_delete');
Line 1929: return new AdminError("Invalid id specified - page does not exist");
Line 1933: $res = AdminPerms::checkPermissionsTree('pages', $id);
Line 1934: if (! $res) return new AdminError("Access denied to delete this page");
Line 1963: if (!AdminPerms::checkPermissionsTree('pages', $item_id)) {
Line 1987: $res = AdminPerms::checkPermissionsTree('pages', $id);
Line 1990: $view = new View('sprout/admin/page_linklist');
Line 2031: $list->addAction('edit', "SITE/admin/edit/{$this->controller_name}/%%");
Line 2064: * Looks for a view named "admin/<controller-name>_intro", and loads it if found.
Line 2065: * Otherwise, loads the view, "admin/generic_intro".
Line 2069: $intro = new View("sprout/admin/page_intro");
Line 2081: $res = Pdb::q($q, [$_SESSION['admin']['active_subsite']], 'arr');
Line 2087: $itemlist->addAction('edit', "SITE/admin/edit/{$this->controller_name}/%%");
Line 2093: if (AdminPerms::canAccess('access_noapproval')) {
Line 2102: $res = Pdb::q($q, ['need_approval', $_SESSION['admin']['active_subsite']], 'arr');
Line 2112: $itemlist->addAction('edit', 'SITE/admin/edit/page/%%#main-tabs-revs');
Line 2149: AdminAuth::checkLogin();
Line 2220: AdminAuth::checkLogin();
Line 2225: Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true);
Line 2230: $nav_limit = Subsites::getConfigAdmin('nav_limit');
Line 2232: if (Subsites::getConfigAdmin('nav_home')) $nav_limit--;
Line 2247: $admin_perms = AdminPerms::checkPermissionsTree('pages', $top_node['id']);
Line 2249: $class = ($admin_perms ? ' allow-access' : ' no-access');
Line 2262: $admin_perms = AdminPerms::checkPermissionsTree('pages', $child['id']);
Line 2264: $class = ($admin_perms ? ' allow-access' : ' no-access');
Line 2265: if (count($child->children) > 0 and $admin_perms) {
Line 2284: echo "&#43; <a href=\"SITE/admin/add/page?parent_id={$top_node['id']}\">Add Child</a>";
Line 2290: if ($_SESSION['admin'][$this->controller_name . '_nav'] == null) $_SESSION['admin'][$this->controller_name . '_nav'] = array();
Line 2291: if ($_POST['dir'] != '/' and !in_array ($_POST['dir'], $_SESSION['admin'][$this->controller_name . '_nav'])) {
Line 2292: $_SESSION['admin'][$this->controller_name . '_nav'][] = $_POST['dir'];
Line 2302: AdminAuth::checkLogin();
Line 2304: if (empty($_SESSION['admin'][$this->controller_name . '_nav'])) return;
Line 2306: $index = array_search ($_POST['dir'], $_SESSION['admin'][$this->controller_name . '_nav']);
Line 2307: unset ($_SESSION['admin'][$this->controller_name . '_nav'][$index]);
Line 2317: AdminAuth::checkLogin();
Line 2324: $children = Pdb::q($q, [$_SESSION['admin']['active_subsite']], 'arr');
Line 2333: $view = new View('sprout/admin/categories_reorder');
Line 2462: $items[] = "<li class=\"import\"><a href=\"SITE/admin/import_upload/page\">Document import</a></li>";
Line 2465: $items[] = "<li class=\"action-log\"><a href=\"SITE/admin/search/{$this->controller_name}\">Search pages</a></li>";
Line 2467: if (AdminPerms::canAccess('access_noapproval')) {
Line 2468: $items[] = "<li class=\"action-log\"><a href=\"admin/extra/page/need_approval\">Pages needing approval</a></li>";
Line 2471: if (AdminAuth::isSuper() or Subsites::getConfigAdmin('nav_reorder')) {
Line 2473: $items[] = "<li class=\"reorder\"><a href=\"admin/call/{$this->controller_name}/reorderTop\" onclick=\"$.facebox({'ajax':this.href}); return false;\">Reorder top-level</a></li>";
Line 2476: if (AdminAuth::isSuper()) {
Line 2477: $items[] = "<li class=\"config\"><a href=\"admin/extra/page/organise\">Sitemap manager</a></li>";
Line 2480: if (Subsites::getConfigAdmin('nav_groups') !== null) {
Line 2481: $items[] = "<li class=\"config\"><a href=\"admin/extra/page/menu_groups\">Manage menu groups</a></li>";
Line 2484: $items[] = "<li class=\"config\"><a href=\"admin/extra/page/link_checker\">Link checker</a></li>";
Line 2491: $tools[] = '<li class="action-log"><a href="SITE/admin/contents/action_log?record_table=' . $this->getTableName() . '">View action log</a></li>';
Line 2503: $view = new View('sprout/admin/link_checker');
Line 2504: $view->ops = AdminPerms::getOperatorsWithAccess('access_reportemail');
Line 2506: $details = AdminAuth::getDetails();
Line 2521: AdminAuth::checkLogin();
Line 2527: if ($_POST['send_to'] != 'admins' and $_POST['send_to'] != 'specific') {
Line 2529: Url::redirect('admin/extra/page/link_checker');
Line 2534: Url::redirect('admin/extra/page/link_checker');
Line 2538: if ($_POST['send_to'] == 'admins') {
Line 2545: Url::redirect('admin/extra/page/link_checker');
Line 2549: Url::redirect('admin/extra/page/link_checker_info/' . $info['job_id']);
Line 2577: if (!AdminPerms::canAccess('access_noapproval')) {
Line 2589: $res = Pdb::query($q, [$_SESSION['admin']['active_subsite']], 'arr');
Line 2598: $itemlist->addAction('edit', 'admin/edit/page/%%');
Line 2734: AdminAuth::checkLogin();
Line 2739: Url::redirect('admin/intro/page');
Line 2751: 'page_admin_permissions' => 1,
Line 2759: // be saved under a different status once the current administrator is happy with the preview

/sprout/Controllers/Admin/PerRecordPermissionAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 18: use Sprout\Helpers\Admin;
Line 19: use Sprout\Helpers\AdminAuth;
Line 20: use Sprout\Helpers\AdminError;
Line 21: use Sprout\Helpers\AdminPerms;
Line 37: class PerRecordPermissionAdminController extends NoRecordsAdminController
Line 51: $controllers = Register::getAdminControllers();
Line 66: if ($reflect->isSubclassOf('Sprout\\Controllers\\Admin\\CategoryAdminController')) {
Line 72: if ($reflect->isSubclassOf('Sprout\\Controllers\\Admin\\NoRecordsAdminController')) {
Line 93: $out .= "<li><a href=\"admin/contents/{$this->controller_name}\">Configure tabs</a></li>";
Line 94: $out .= "<li><a href=\"admin/extra/per_record_permission/reset\">Reset a single tab</a></li>";
Line 106: * @return array Contains elements 'title' and 'content' as per {@see ManagedAdminController::_getContents}
Line 110: if (!AdminPerms::canAccess('access_operators')) return new AdminError('Access denied');
Line 114: $view = new View('sprout/admin/per_record_perms');
Line 131: if (!AdminPerms::canAccess('access_operators')) return new AdminError('Access denied');
Line 183: Url::redirect('admin/contents/' . $this->controller_name);
Line 200: $out = '<form method="post" action="admin/call/' . $this->controller_name . '/resetSave">';
Line 208: $all_cats = AdminAuth::getAllCategories();
Line 209: unset($all_cats[AdminAuth::getPrimaryCategoryId()]);
Line 237: $url = 'admin/extra/' . $this->controller_name . '/reset';
Line 248: $ctlr = Admin::getController($_POST['controller']);

/sprout/Controllers/Admin/PerRecordPermissionAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 18: use Sprout\Helpers\Admin;
Line 19: use Sprout\Helpers\AdminAuth;
Line 20: use Sprout\Helpers\AdminError;
Line 21: use Sprout\Helpers\AdminPerms;
Line 37: class PerRecordPermissionAdminController extends NoRecordsAdminController
Line 51: $controllers = Register::getAdminControllers();
Line 66: if ($reflect->isSubclassOf('Sprout\\Controllers\\Admin\\CategoryAdminController')) {
Line 72: if ($reflect->isSubclassOf('Sprout\\Controllers\\Admin\\NoRecordsAdminController')) {
Line 93: $out .= "<li><a href=\"admin/contents/{$this->controller_name}\">Configure tabs</a></li>";
Line 94: $out .= "<li><a href=\"admin/extra/per_record_permission/reset\">Reset a single tab</a></li>";
Line 106: * @return array Contains elements 'title' and 'content' as per {@see ManagedAdminController::_getContents}
Line 110: if (!AdminPerms::canAccess('access_operators')) return new AdminError('Access denied');
Line 114: $view = new View('sprout/admin/per_record_perms');
Line 131: if (!AdminPerms::canAccess('access_operators')) return new AdminError('Access denied');
Line 183: Url::redirect('admin/contents/' . $this->controller_name);
Line 200: $out = '<form method="post" action="admin/call/' . $this->controller_name . '/resetSave">';
Line 208: $all_cats = AdminAuth::getAllCategories();
Line 209: unset($all_cats[AdminAuth::getPrimaryCategoryId()]);
Line 237: $url = 'admin/extra/' . $this->controller_name . '/reset';
Line 248: $ctlr = Admin::getController($_POST['controller']);

/sprout/Controllers/Admin/RedirectAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 27: class RedirectAdminController extends HasCategoriesAdminController

/sprout/Controllers/Admin/RedirectAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 27: class RedirectAdminController extends HasCategoriesAdminController

/sprout/Controllers/Admin/RedirectCategoryAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 19: class RedirectCategoryAdminController extends CategoryAdminController

/sprout/Controllers/Admin/RedirectCategoryAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 19: class RedirectCategoryAdminController extends CategoryAdminController

/sprout/Controllers/Admin/SubsiteAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 28: class SubsiteAdminController extends ListAdminController
Line 55: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 66: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 85: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 117: $update_fields['require_admin'] = (int) (bool) @$_POST['require_admin'];
Line 149: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}
Line 184: $update_fields['require_admin'] = (int) (bool) @$_POST['require_admin'];
Line 214: Url::redirect('admin/contents/subsite');

/sprout/Controllers/Admin/SubsiteAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 28: class SubsiteAdminController extends ListAdminController
Line 55: $_SESSION['admin']['field_values'] = Validator::trim($_POST);
Line 66: $_SESSION['admin']['field_errors'] = $valid->getFieldErrors();
Line 85: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 117: $update_fields['require_admin'] = (int) (bool) @$_POST['require_admin'];
Line 149: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}
Line 184: $update_fields['require_admin'] = (int) (bool) @$_POST['require_admin'];
Line 214: Url::redirect('admin/contents/subsite');

/sprout/Controllers/Admin/TreeAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 18: use Sprout\Helpers\AdminAuth;
Line 19: use Sprout\Helpers\AdminPerms;
Line 42: abstract class TreeAdminController extends ManagedAdminController {
Line 61: if (!empty($_SESSION['admin'][$this->controller_name . '_nav'])) {
Line 62: $nodes_string = "'" . implode ("', '", $_SESSION['admin'][$this->controller_name . '_nav']) . "'";
Line 65: $view = new View('sprout/admin/tree_navigation');
Line 81: if (AdminAuth::isSuper()) {
Line 83: $items[] = "<li class=\"reorder\"><a href=\"admin/call/{$this->controller_name}/reorderTop\" onclick=\"$.facebox({'ajax':this.href}); return false;\">Reorder top-level</a></li>";
Line 86: $items[] = "<li class=\"config\"><a href=\"admin/extra/{$this->controller_name}/organise\">Organise tree</a></li>";
Line 124: $view = new View("{$this->getModulePath()}/admin/{$this->controller_name}_delete");
Line 126: $view = new View("sprout/admin/tree_delete");
Line 216: if (! AdminPerms::controllerAccess($this->getControllerName(), 'reorder')) {
Line 255: $view = new View('sprout/admin/categories_reorder');
Line 271: if (! AdminPerms::controllerAccess($this->getControllerName(), 'reorder')) {
Line 290: $view = new View('sprout/admin/categories_reorder');
Line 304: AdminAuth::checkLogin();
Line 307: if (! AdminPerms::controllerAccess($this->getControllerName(), 'reorder')) {
Line 309: Url::redirect('admin/contents/' . $this->getControllerName());
Line 328: Url::redirect("admin/intro/" . $this->controller_name);
Line 359: $view = new View('sprout/admin/tree_organise');
Line 372: * @return void Admin will be redirected to a follow-up page
Line 381: Url::redirect('admin/extra/' . $this->controller_name . '/organise');
Line 415: if (AdminAuth::isSuper()) {
Line 424: Url::redirect('admin/extra/' . $this->controller_name . '/organise');
Line 482: echo "&#43; <a href=\"SITE/admin/add/{$this->controller_name}?parent_id={$parent_id}\">Add Child</a>";
Line 488: if (empty($_SESSION['admin'][$this->controller_name . '_nav'])) {
Line 489: $_SESSION['admin'][$this->controller_name . '_nav'] = array();
Line 491: if ($_POST['dir'] != '/' and !in_array ($_POST['dir'], $_SESSION['admin'][$this->controller_name . '_nav'])) {
Line 492: $_SESSION['admin'][$this->controller_name . '_nav'][] = $_POST['dir'];
Line 502: if (empty($_SESSION['admin'][$this->controller_name . '_nav'])) return;
Line 504: $index = array_search ($_POST['dir'], $_SESSION['admin'][$this->controller_name . '_nav']);
Line 505: unset ($_SESSION['admin'][$this->controller_name . '_nav'][$index]);

/sprout/Controllers/Admin/TreeAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 18: use Sprout\Helpers\AdminAuth;
Line 19: use Sprout\Helpers\AdminPerms;
Line 42: abstract class TreeAdminController extends ManagedAdminController {
Line 61: if (!empty($_SESSION['admin'][$this->controller_name . '_nav'])) {
Line 62: $nodes_string = "'" . implode ("', '", $_SESSION['admin'][$this->controller_name . '_nav']) . "'";
Line 65: $view = new View('sprout/admin/tree_navigation');
Line 81: if (AdminAuth::isSuper()) {
Line 83: $items[] = "<li class=\"reorder\"><a href=\"admin/call/{$this->controller_name}/reorderTop\" onclick=\"$.facebox({'ajax':this.href}); return false;\">Reorder top-level</a></li>";
Line 86: $items[] = "<li class=\"config\"><a href=\"admin/extra/{$this->controller_name}/organise\">Organise tree</a></li>";
Line 124: $view = new View("{$this->getModulePath()}/admin/{$this->controller_name}_delete");
Line 126: $view = new View("sprout/admin/tree_delete");
Line 216: if (! AdminPerms::controllerAccess($this->getControllerName(), 'reorder')) {
Line 255: $view = new View('sprout/admin/categories_reorder');
Line 271: if (! AdminPerms::controllerAccess($this->getControllerName(), 'reorder')) {
Line 290: $view = new View('sprout/admin/categories_reorder');
Line 304: AdminAuth::checkLogin();
Line 307: if (! AdminPerms::controllerAccess($this->getControllerName(), 'reorder')) {
Line 309: Url::redirect('admin/contents/' . $this->getControllerName());
Line 328: Url::redirect("admin/intro/" . $this->controller_name);
Line 359: $view = new View('sprout/admin/tree_organise');
Line 372: * @return void Admin will be redirected to a follow-up page
Line 381: Url::redirect('admin/extra/' . $this->controller_name . '/organise');
Line 415: if (AdminAuth::isSuper()) {
Line 424: Url::redirect('admin/extra/' . $this->controller_name . '/organise');
Line 482: echo "&#43; <a href=\"SITE/admin/add/{$this->controller_name}?parent_id={$parent_id}\">Add Child</a>";
Line 488: if (empty($_SESSION['admin'][$this->controller_name . '_nav'])) {
Line 489: $_SESSION['admin'][$this->controller_name . '_nav'] = array();
Line 491: if ($_POST['dir'] != '/' and !in_array ($_POST['dir'], $_SESSION['admin'][$this->controller_name . '_nav'])) {
Line 492: $_SESSION['admin'][$this->controller_name . '_nav'][] = $_POST['dir'];
Line 502: if (empty($_SESSION['admin'][$this->controller_name . '_nav'])) return;
Line 504: $index = array_search ($_POST['dir'], $_SESSION['admin'][$this->controller_name . '_nav']);
Line 505: unset ($_SESSION['admin'][$this->controller_name . '_nav'][$index]);

/sprout/Controllers/Admin/WorkerJobAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 18: use Sprout\Helpers\AdminAuth;
Line 36: class WorkerJobAdminController extends ListAdminController
Line 107: $view = new View('sprout/admin/worker_job_manual_run');
Line 122: AdminAuth::checkLogin();
Line 127: Url::redirect('admin/extra/worker_job/manual_run');
Line 134: Url::redirect('admin/extra/worker_job/manual_run');
Line 170: AdminAuth::checkLogin();

/sprout/Controllers/Admin/WorkerJobAdminController.php   Highlighted file source

Line 14: namespace Sprout\Controllers\Admin;
Line 18: use Sprout\Helpers\AdminAuth;
Line 36: class WorkerJobAdminController extends ListAdminController
Line 107: $view = new View('sprout/admin/worker_job_manual_run');
Line 122: AdminAuth::checkLogin();
Line 127: Url::redirect('admin/extra/worker_job/manual_run');
Line 134: Url::redirect('admin/extra/worker_job/manual_run');
Line 170: AdminAuth::checkLogin();

/sprout/Controllers/AdminAjaxController.php   Highlighted file source

Line 21: use Sprout\Helpers\Admin;
Line 22: use Sprout\Helpers\AdminAuth;
Line 44: * Handles processing of various admin AJAX methods including: widget settings; links; and categories.
Line 46: class AdminAjaxController extends Controller
Line 69: AdminAuth::checkLogin();
Line 135: AdminAuth::checkLogin();
Line 141: 'url' => 'admin_ajax/widget_disp_cond_params',
Line 144: $view = new View('sprout/admin/widget_disp_conds');
Line 163: AdminAuth::checkLogin();
Line 199: AdminAuth::checkLogin();
Line 231: AdminAuth::checkLogin();
Line 233: echo new View('sprout/admin/footer_compat');
Line 239: AdminAuth::checkLogin();
Line 247: AdminAuth::checkLogin();
Line 270: AdminAuth::checkLogin();
Line 312: AdminAuth::checkLogin();
Line 355: AdminAuth::checkLogin();
Line 368: Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true);
Line 401: AdminAuth::checkLogin();
Line 402: Admin::setTourCompleted($tour_name);
Line 414: AdminAuth::checkLogin();
Line 430: AdminAuth::checkLogin();
Line 477: AdminAuth::checkLogin();

/sprout/Controllers/AdminAjaxController.php   Highlighted file source

Line 21: use Sprout\Helpers\Admin;
Line 22: use Sprout\Helpers\AdminAuth;
Line 44: * Handles processing of various admin AJAX methods including: widget settings; links; and categories.
Line 46: class AdminAjaxController extends Controller
Line 69: AdminAuth::checkLogin();
Line 135: AdminAuth::checkLogin();
Line 141: 'url' => 'admin_ajax/widget_disp_cond_params',
Line 144: $view = new View('sprout/admin/widget_disp_conds');
Line 163: AdminAuth::checkLogin();
Line 199: AdminAuth::checkLogin();
Line 231: AdminAuth::checkLogin();
Line 233: echo new View('sprout/admin/footer_compat');
Line 239: AdminAuth::checkLogin();
Line 247: AdminAuth::checkLogin();
Line 270: AdminAuth::checkLogin();
Line 312: AdminAuth::checkLogin();
Line 355: AdminAuth::checkLogin();
Line 368: Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true);
Line 401: AdminAuth::checkLogin();
Line 402: Admin::setTourCompleted($tour_name);
Line 414: AdminAuth::checkLogin();
Line 430: AdminAuth::checkLogin();
Line 477: AdminAuth::checkLogin();

/sprout/Controllers/AdminController.php   Highlighted file source

Line 24: use Sprout\Controllers\Admin\CategoryAdminController;
Line 25: use Sprout\Controllers\Admin\ManagedAdminController;
Line 26: use Sprout\Controllers\Admin\PageAdminController;
Line 30: use Sprout\Helpers\Admin;
Line 31: use Sprout\Helpers\AdminAuth;
Line 32: use Sprout\Helpers\AdminDashboard;
Line 33: use Sprout\Helpers\AdminError;
Line 34: use Sprout\Helpers\AdminPerms;
Line 35: use Sprout\Helpers\AdminSeo;
Line 65: * Main class to handle admin processing.
Line 66: * This delegates processing to controllers registered with {@see Register::adminControllers}
Line 68: class AdminController extends Controller
Line 72: * Does some general admin loading
Line 81: $whitelist = Kohana::config('sprout.admin_ips');
Line 90: $admin_url = Replication::adminUrl();
Line 91: if ($admin_url) {
Line 92: Url::redirect($admin_url);
Line 95: AdminPerms::loadAccessFlags();
Line 98: $domain = Kohana::config('sprout.admin_domain');
Line 113: AdminAuth::checkLogin();
Line 116: Navigation::loadPageTree(@$_SESSION['admin']['active_subsite'], true);
Line 122: $path .= '/admin_load.php';
Line 128: if (! Kohana::config('sprout.admin_intro')) {
Line 129: Kohana::configSet('sprout.admin_intro', 'admin/dashboard');
Line 134: * Home page of admin area
Line 138: AdminAuth::checkLogin();
Line 139: Url::redirect(Kohana::config('sprout.admin_intro'));
Line 147: if (AdminAuth::isLoggedIn()) {
Line 148: Url::redirect(Kohana::config('sprout.admin_intro'));
Line 151: $view = new View('sprout/admin/login_layout');
Line 155: $view->admin_authenticated = false;
Line 159: $msg = Sprout::extraPage(Constants::EXTRAPAGES_ADMIN_LOGIN);
Line 161: $view->main_content = new View('sprout/admin/login_message');
Line 165: $view->main_content = new View('sprout/admin/login_form');
Line 191: Url::redirect('admin/login?username=' . Enc::url($_POST['Username']) . '&redirect=' . Enc::url($_POST['redirect']) . '&nomsg=1');
Line 194: $result = AdminAuth::checkRateLimit($_POST['Username'], Request::userIp());
Line 200: Url::redirect('admin/login&redirect=' . Enc::url($_POST['redirect']) . '&nomsg=1');
Line 203: $result = AdminAuth::processLogin($_POST['Username'], $_POST['Password']);
Line 206: $result = AdminAuth::processRemote($_POST['Username'], $_POST['Password']);
Line 210: $result = AdminAuth::processLocal($_POST['Username'], $_POST['Password']);
Line 213: AdminAuth::saveLoginAttempt($_POST['Username'], Request::userIp(), $result === true ? 1 : 0);
Line 217: Url::redirect('admin/login?username=' . Enc::url($_POST['Username']) . '&redirect=' . Enc::url($_POST['redirect']) . '&nomsg=1');
Line 221: if (isset($_SESSION['admin']['tfa_id'])) {
Line 222: Url::redirect('admin/login-two-factor?redirect=' . $_POST['redirect']);
Line 234: if (!isset($_SESSION['admin']['tfa_id'])) {
Line 235: Url::redirect('admin/login');
Line 240: $tfa_method = Pdb::query($q, [$_SESSION['admin']['tfa_id']], 'val');
Line 242: Url::redirect('admin/login');
Line 252: $view->action_url = 'admin/login-two-factor-action';
Line 259: $skin = new View('sprout/admin/login_layout');
Line 272: if (!isset($_SESSION['admin']['tfa_id'])) {
Line 273: Url::redirect('admin/login');
Line 279: $operator = Pdb::query($q, [$_SESSION['admin']['tfa_id']], 'row');
Line 293: Url::redirect('admin/login-two-factor?redirect=' . $_POST['redirect']);
Line 296: $_SESSION['admin']['login_id'] = $_SESSION['admin']['tfa_id'];
Line 297: unset($_SESSION['admin']['tfa_id']);
Line 303: * Set up various login params and redirect into admin
Line 315: Url::redirect('admin/login?username=' . Enc::url($_POST['Username']) . '&redirect=' . Enc::url($_POST['redirect']) . '&nomsg=1');
Line 319: if (!AdminAuth::isSuper()) {
Line 320: $cats = Category::categoryList('operators', AdminAuth::getId());
Line 323: Url::redirect('admin/login?username=' . Enc::url($_POST['Username']) . '&redirect=' . Enc::url($_POST['redirect']) . '&nomsg=1');
Line 327: $_SESSION['admin']['active_subsite'] = $subsite;
Line 329: Notification::confirm('You are now logged in to the admin control panel');
Line 334: Url::redirect(Kohana::config('sprout.admin_intro'));
Line 344: Admin::unlock();
Line 348: AdminAuth::logout();
Line 354: Url::redirect('admin/login');
Line 359: * View the various styles available in the admin area
Line 364: AdminAuth::checkLogin();
Line 366: $buttons = new View('sprout/admin/style_guide/index');
Line 369: $inner_view = new View('sprout/admin/style_guide/' . $section);
Line 374: $view = new View('sprout/admin/main_layout');
Line 375: $ctlr = $this->getController('Sprout\Controllers\Admin\PageAdminController');
Line 388: * Dashboard shown when a user first logs in to the admin
Line 392: AdminAuth::checkLogin();
Line 394: $first = AdminPerms::getFirstAccessable();
Line 396: Url::redirect('admin/intro/my_settings');
Line 398: Url::redirect('admin/intro/' . $first);
Line 401: $ctlr = $this->getController('Sprout\Controllers\Admin\PageAdminController');
Line 404: $dash_html = AdminDashboard::render();
Line 406: $view = new View('sprout/admin/main_layout');
Line 411: $view->main_title = 'SproutCMS Administration';
Line 418: * Closes the 'first run' box, which is shown on the admin dashboard
Line 420: * @return void Redirects to the admin dashboard
Line 424: AdminAuth::checkLogin();
Line 429: ['id' => AdminAuth::getId()]
Line 432: Url::redirect('admin/dashboard');
Line 443: AdminAuth::checkLogin();
Line 448: $view = new View('sprout/admin/main_layout');
Line 473: AdminAuth::checkLogin();
Line 477: $view = new View('sprout/admin/main_layout');
Line 487: if ($main instanceof AdminError) {
Line 510: AdminAuth::checkLogin();
Line 514: $view = new View('sprout/admin/main_layout');
Line 524: if ($main instanceof AdminError) {
Line 547: AdminAuth::checkLogin();
Line 549: $view = new View('sprout/admin/main_layout');
Line 559: if ($main instanceof AdminError) {
Line 581: AdminAuth::checkLogin();
Line 592: Url::redirect("admin/export/{$type}");
Line 615: AdminAuth::checkLogin();
Line 617: $view = new View('sprout/admin/main_layout');
Line 632: $main = new View('sprout/admin/import_upload');
Line 649: AdminAuth::checkLogin();
Line 697: Url::redirect("admin/import_upload/{$type}");
Line 700: Url::redirect("admin/import_options/{$type}?timestamp={$timestamp}");
Line 710: AdminAuth::checkLogin();
Line 723: $view = new View('sprout/admin/main_layout');
Line 733: if ($main instanceof AdminError) {
Line 754: AdminAuth::checkLogin();
Line 776: Url::redirect("admin/import_options/{$type}?timestamp={$_POST['timestamp']}&ext={$_POST['ext']}");
Line 784: Url::redirect("admin/contents/{$type}");
Line 789: * Shows an error message in the admin skin
Line 792: * @param ManagedAdminController $ctlr A controller to show the navigation of.
Line 794: private function error($message, ManagedAdminController $ctlr = null)
Line 796: AdminAuth::checkLogin();
Line 798: $content = new View('sprout/admin/error');
Line 801: $view = new View('sprout/admin/main_layout');
Line 820: * @param ManagedAdminController $ctlr A controller to check
Line 825: private function checkAccess(ManagedAdminController $ctlr, $access_flag, $action)
Line 827: AdminAuth::checkLogin();
Line 829: if ($ctlr instanceof CategoryAdminController) {
Line 834: if (AdminPerms::controllerAccess($ctlr->getControllerName(), $access_flag)) {
Line 840: Url::redirect('admin');
Line 843: $content = new View('sprout/admin/access_denied');
Line 847: $view = new View('sprout/admin/main_layout');
Line 865: * Checks that an admin user has access to an individual record
Line 867: * @param ManagedAdminController $ctlr The controller which manages the table containing the record
Line 871: function checkRecordAccess(ManagedAdminController $ctlr, $item_id)
Line 896: * @param ManagedAdminController $ctlr
Line 898: private function cleanupCommonPostData(ManagedAdminController $ctlr)
Line 966: * @param string ManagedAdminController $ctlr The controller to check permissions for
Line 970: protected function perRecordPermissionsFields(ManagedAdminController $ctlr, $item_id)
Line 993: if (AdminPerms::canAccess('access_operators')) {
Line 994: $cat_list = AdminAuth::getAllCategories();
Line 997: $cat_ids = AdminAuth::getOperatorCategories();
Line 1014: // Don't display primary administrators category; they always get access
Line 1015: $primary_cat_id = AdminAuth::getPrimaryCategoryId();
Line 1021: // N.B. primary admins don't have any categories ticked because they belong to ALL categories,
Line 1024: if (!AdminAuth::inCategory($primary_cat_id)) {
Line 1031: if ($item_id == 0 or AdminAuth::inCategory($primary_cat_id)) {
Line 1035: // Hack in 'all operators' option for primary admins
Line 1036: if (AdminAuth::inCategory($primary_cat_id)) {
Line 1060: AdminAuth::checkLogin();
Line 1066: $view = new View('sprout/admin/main_layout');
Line 1072: if ($main instanceof AdminError) {
Line 1085: $class = 'admin-ajax action-add type-' . Enc::id($type);
Line 1088: echo '<form action="admin/add_save/' . Enc::html($ctlr->getControllerName()) . '" method="post">';
Line 1098: $tags = new View('sprout/admin/main_tags');
Line 1103: $tags->current_tags = @$_SESSION['admin']['tags'];
Line 1104: unset ($_SESSION['admin']['tags']);
Line 1108: $content = '<form action="admin/add_save/' . Enc::html($ctlr->getControllerName()) . '" method="post" id="edit-form" class="-clearfix">';
Line 1138: Form::setFieldValue('subsite_id', $_SESSION['admin']['active_subsite']);
Line 1176: AdminAuth::checkLogin();
Line 1185: $_SESSION['admin']['tags'] = $_POST['tags'];
Line 1206: Url::redirect("admin/add/{$type}");
Line 1211: unset ($_SESSION['admin']['tags']);
Line 1219: unset ($_SESSION['admin']['field_values']);
Line 1231: Url::redirect("admin/edit/{$type}/{$id}");
Line 1243: AdminAuth::checkLogin();
Line 1246: $view = new View('sprout/admin/main_layout');
Line 1258: if ($main instanceof AdminError) {
Line 1272: $tags = new View('sprout/admin/main_tags');
Line 1276: $tags->current_tags = @$_SESSION['admin']['tags'];
Line 1277: if (empty($_SESSION['admin']['tags'])) {
Line 1280: unset ($_SESSION['admin']['tags']);
Line 1283: $view->enable_seo = !empty(AdminSeo::$content)? true : false;
Line 1286: $content = '<form action="admin/edit_save/' . Enc::html($ctlr->getControllerName()) . '/' . $id;
Line 1291: $content .= AdminSeo::getAnalysis();
Line 1347: $view->live_url = Admin::ensureUrlAbsolute($url);
Line 1361: AdminAuth::checkLogin();
Line 1374: $_SESSION['admin']['tags'] = $_POST['tags'];
Line 1386: Url::redirect("admin/edit/{$type}/{$id}");
Line 1390: if ($result and AdminPerms::canAccess('access_operators')) {
Line 1396: unset ($_SESSION['admin']['tags']);
Line 1404: unset ($_SESSION['admin']['field_values']);
Line 1412: Url::redirect("admin/edit/{$type}/{$id}");
Line 1419: * @param string $type Shorthand controller name; see {@see Register::adminControllers}
Line 1424: AdminAuth::checkLogin();
Line 1433: if ($main instanceof AdminError) {
Line 1446: $view = new View('sprout/admin/main_layout');
Line 1451: $content = '<form action="admin/delete_save/' . Enc::html($ctlr->getControllerName()) . '/' . $id . '" method="post" id="edit-form">';
Line 1491: AdminAuth::checkLogin();
Line 1503: Url::redirect("admin/delete/{$type}/{$id}");
Line 1512: Url::redirect("admin/edit/{$type}/{$id}");
Line 1527: Url::redirect("admin/delete/{$type}/{$id}");
Line 1537: Url::redirect("admin/contents/{$type}");
Line 1551: AdminAuth::checkLogin();
Line 1554: $view = new View('sprout/admin/main_layout');
Line 1571: if ($main instanceof AdminError) {
Line 1583: $tags = new View('sprout/admin/main_tags');
Line 1588: $tags->current_tags = @$_SESSION['admin']['tags'];
Line 1589: if (empty($_SESSION['admin']['tags'])) {
Line 1592: unset ($_SESSION['admin']['tags']);
Line 1602: $content = '<form action="admin/duplicate_save/' . Enc::html($ctlr->getControllerName()) . '/' . $id . '" method="post" id="edit-form">';
Line 1663: AdminAuth::checkLogin();
Line 1675: $_SESSION['admin']['tags'] = $_POST['tags'];
Line 1728: Url::redirect("admin/duplicate/{$type}/{$orig_id}");
Line 1733: unset ($_SESSION['admin']['tags']);
Line 1741: unset ($_SESSION['admin']['field_values']);
Line 1743: Url::redirect("admin/edit/{$type}/{$id}");
Line 1752: AdminAuth::checkLogin();
Line 1754: $view = new View('sprout/admin/main_layout');
Line 1756: $this->setNavigation($view, new PageAdminController());
Line 1766: $out = '<form action="SITE/admin/moderate_action" method="post">';
Line 1820: AdminAuth::checkLogin();
Line 1853: Url::redirect('admin/moderate');
Line 1869: * class BookingAdminController extends ManagedAdminController {
Line 1870: * // Call with url admin/extra/booking/send_email/:record_id
Line 1876: * @param string $type The class name of the method to call (must extend ManagedAdminController)
Line 1882: AdminAuth::checkLogin();
Line 1902: $view = new View('sprout/admin/main_layout');
Line 1910: if ($main instanceof AdminError) {
Line 1930: * Directly calls a method provided by an admin controller
Line 1939: AdminAuth::checkLogin();
Line 1942: if (!$ctlr or !($ctlr instanceof ManagedAdminController)) {
Line 1963: * Sets the active subsite, and then redirects back to the admin area.
Line 1968: AdminAuth::checkLogin();
Line 1977: if (!AdminPerms::canAccessSubsite($_POST['subsite'])) {
Line 1979: Url::redirect(Kohana::config('sprout.admin_intro'));
Line 1982: $_SESSION['admin']['active_subsite'] = $_POST['subsite'];
Line 1985: Url::redirect(Kohana::config('sprout.admin_intro'));
Line 2015: $view->admin_authenticated = true;
Line 2029: $view->info_message = new View('sprout/admin/message_bad_browser');
Line 2035: if (!empty($_SESSION['admin'])) {
Line 2036: $view->live_url = Subsites::getAbsRoot($_SESSION['admin']['active_subsite']);
Line 2043: * @deprecated This function is now just an alias for {@see Admin::getController}
Line 2053: return Admin::getController($type);
Line 2060: * @param string $type Admin controller slug, e.g. 'page'
Line 2066: if (! Admin::locksEnabled()) return;
Line 2071: $lock = Admin::getLock($type, $id);
Line 2075: $lock_id = Admin::lock($type, $id);
Line 2083: } else if ($lock['lock_key'] == $_SESSION['admin']['lock_key']) {
Line 2085: Admin::pingLock($lock['id']);
Line 2105: Admin::unlock($type, $id);
Line 2115: AdminAuth::checkLogin();
Line 2121: Admin::unlock($_POST['ctlr'], $_POST['record_id']);
Line 2133: AdminAuth::checkLogin();
Line 2179: Url::redirect('admin/edit/action_log/' . $log_id);
Line 2182: $op = AdminAuth::getDetails();
Line 2191: Url::redirect('admin/edit/' . Enc::url($ctlr->getControllerName()) . '/' . $main_record['record_id']);
Line 2193: Url::redirect('admin/edit/action_log/' . $log_id);
Line 2317: AdminAuth::checkLogin();
Line 2324: Admin::pingLock($_GET['lock_id']);
Line 2325: Admin::clearOldLocks();

/sprout/Controllers/AdminController.php   Highlighted file source

Line 24: use Sprout\Controllers\Admin\CategoryAdminController;
Line 25: use Sprout\Controllers\Admin\ManagedAdminController;
Line 26: use Sprout\Controllers\Admin\PageAdminController;
Line 30: use Sprout\Helpers\Admin;
Line 31: use Sprout\Helpers\AdminAuth;
Line 32: use Sprout\Helpers\AdminDashboard;
Line 33: use Sprout\Helpers\AdminError;
Line 34: use Sprout\Helpers\AdminPerms;
Line 35: use Sprout\Helpers\AdminSeo;
Line 65: * Main class to handle admin processing.
Line 66: * This delegates processing to controllers registered with {@see Register::adminControllers}
Line 68: class AdminController extends Controller
Line 72: * Does some general admin loading
Line 81: $whitelist = Kohana::config('sprout.admin_ips');
Line 90: $admin_url = Replication::adminUrl();
Line 91: if ($admin_url) {
Line 92: Url::redirect($admin_url);
Line 95: AdminPerms::loadAccessFlags();
Line 98: $domain = Kohana::config('sprout.admin_domain');
Line 113: AdminAuth::checkLogin();
Line 116: Navigation::loadPageTree(@$_SESSION['admin']['active_subsite'], true);
Line 122: $path .= '/admin_load.php';
Line 128: if (! Kohana::config('sprout.admin_intro')) {
Line 129: Kohana::configSet('sprout.admin_intro', 'admin/dashboard');
Line 134: * Home page of admin area
Line 138: AdminAuth::checkLogin();
Line 139: Url::redirect(Kohana::config('sprout.admin_intro'));
Line 147: if (AdminAuth::isLoggedIn()) {
Line 148: Url::redirect(Kohana::config('sprout.admin_intro'));
Line 151: $view = new View('sprout/admin/login_layout');
Line 155: $view->admin_authenticated = false;
Line 159: $msg = Sprout::extraPage(Constants::EXTRAPAGES_ADMIN_LOGIN);
Line 161: $view->main_content = new View('sprout/admin/login_message');
Line 165: $view->main_content = new View('sprout/admin/login_form');
Line 191: Url::redirect('admin/login?username=' . Enc::url($_POST['Username']) . '&redirect=' . Enc::url($_POST['redirect']) . '&nomsg=1');
Line 194: $result = AdminAuth::checkRateLimit($_POST['Username'], Request::userIp());
Line 200: Url::redirect('admin/login&redirect=' . Enc::url($_POST['redirect']) . '&nomsg=1');
Line 203: $result = AdminAuth::processLogin($_POST['Username'], $_POST['Password']);
Line 206: $result = AdminAuth::processRemote($_POST['Username'], $_POST['Password']);
Line 210: $result = AdminAuth::processLocal($_POST['Username'], $_POST['Password']);
Line 213: AdminAuth::saveLoginAttempt($_POST['Username'], Request::userIp(), $result === true ? 1 : 0);
Line 217: Url::redirect('admin/login?username=' . Enc::url($_POST['Username']) . '&redirect=' . Enc::url($_POST['redirect']) . '&nomsg=1');
Line 221: if (isset($_SESSION['admin']['tfa_id'])) {
Line 222: Url::redirect('admin/login-two-factor?redirect=' . $_POST['redirect']);
Line 234: if (!isset($_SESSION['admin']['tfa_id'])) {
Line 235: Url::redirect('admin/login');
Line 240: $tfa_method = Pdb::query($q, [$_SESSION['admin']['tfa_id']], 'val');
Line 242: Url::redirect('admin/login');
Line 252: $view->action_url = 'admin/login-two-factor-action';
Line 259: $skin = new View('sprout/admin/login_layout');
Line 272: if (!isset($_SESSION['admin']['tfa_id'])) {
Line 273: Url::redirect('admin/login');
Line 279: $operator = Pdb::query($q, [$_SESSION['admin']['tfa_id']], 'row');
Line 293: Url::redirect('admin/login-two-factor?redirect=' . $_POST['redirect']);
Line 296: $_SESSION['admin']['login_id'] = $_SESSION['admin']['tfa_id'];
Line 297: unset($_SESSION['admin']['tfa_id']);
Line 303: * Set up various login params and redirect into admin
Line 315: Url::redirect('admin/login?username=' . Enc::url($_POST['Username']) . '&redirect=' . Enc::url($_POST['redirect']) . '&nomsg=1');
Line 319: if (!AdminAuth::isSuper()) {
Line 320: $cats = Category::categoryList('operators', AdminAuth::getId());
Line 323: Url::redirect('admin/login?username=' . Enc::url($_POST['Username']) . '&redirect=' . Enc::url($_POST['redirect']) . '&nomsg=1');
Line 327: $_SESSION['admin']['active_subsite'] = $subsite;
Line 329: Notification::confirm('You are now logged in to the admin control panel');
Line 334: Url::redirect(Kohana::config('sprout.admin_intro'));
Line 344: Admin::unlock();
Line 348: AdminAuth::logout();
Line 354: Url::redirect('admin/login');
Line 359: * View the various styles available in the admin area
Line 364: AdminAuth::checkLogin();
Line 366: $buttons = new View('sprout/admin/style_guide/index');
Line 369: $inner_view = new View('sprout/admin/style_guide/' . $section);
Line 374: $view = new View('sprout/admin/main_layout');
Line 375: $ctlr = $this->getController('Sprout\Controllers\Admin\PageAdminController');
Line 388: * Dashboard shown when a user first logs in to the admin
Line 392: AdminAuth::checkLogin();
Line 394: $first = AdminPerms::getFirstAccessable();
Line 396: Url::redirect('admin/intro/my_settings');
Line 398: Url::redirect('admin/intro/' . $first);
Line 401: $ctlr = $this->getController('Sprout\Controllers\Admin\PageAdminController');
Line 404: $dash_html = AdminDashboard::render();
Line 406: $view = new View('sprout/admin/main_layout');
Line 411: $view->main_title = 'SproutCMS Administration';
Line 418: * Closes the 'first run' box, which is shown on the admin dashboard
Line 420: * @return void Redirects to the admin dashboard
Line 424: AdminAuth::checkLogin();
Line 429: ['id' => AdminAuth::getId()]
Line 432: Url::redirect('admin/dashboard');
Line 443: AdminAuth::checkLogin();
Line 448: $view = new View('sprout/admin/main_layout');
Line 473: AdminAuth::checkLogin();
Line 477: $view = new View('sprout/admin/main_layout');
Line 487: if ($main instanceof AdminError) {
Line 510: AdminAuth::checkLogin();
Line 514: $view = new View('sprout/admin/main_layout');
Line 524: if ($main instanceof AdminError) {
Line 547: AdminAuth::checkLogin();
Line 549: $view = new View('sprout/admin/main_layout');
Line 559: if ($main instanceof AdminError) {
Line 581: AdminAuth::checkLogin();
Line 592: Url::redirect("admin/export/{$type}");
Line 615: AdminAuth::checkLogin();
Line 617: $view = new View('sprout/admin/main_layout');
Line 632: $main = new View('sprout/admin/import_upload');
Line 649: AdminAuth::checkLogin();
Line 697: Url::redirect("admin/import_upload/{$type}");
Line 700: Url::redirect("admin/import_options/{$type}?timestamp={$timestamp}");
Line 710: AdminAuth::checkLogin();
Line 723: $view = new View('sprout/admin/main_layout');
Line 733: if ($main instanceof AdminError) {
Line 754: AdminAuth::checkLogin();
Line 776: Url::redirect("admin/import_options/{$type}?timestamp={$_POST['timestamp']}&ext={$_POST['ext']}");
Line 784: Url::redirect("admin/contents/{$type}");
Line 789: * Shows an error message in the admin skin
Line 792: * @param ManagedAdminController $ctlr A controller to show the navigation of.
Line 794: private function error($message, ManagedAdminController $ctlr = null)
Line 796: AdminAuth::checkLogin();
Line 798: $content = new View('sprout/admin/error');
Line 801: $view = new View('sprout/admin/main_layout');
Line 820: * @param ManagedAdminController $ctlr A controller to check
Line 825: private function checkAccess(ManagedAdminController $ctlr, $access_flag, $action)
Line 827: AdminAuth::checkLogin();
Line 829: if ($ctlr instanceof CategoryAdminController) {
Line 834: if (AdminPerms::controllerAccess($ctlr->getControllerName(), $access_flag)) {
Line 840: Url::redirect('admin');
Line 843: $content = new View('sprout/admin/access_denied');
Line 847: $view = new View('sprout/admin/main_layout');
Line 865: * Checks that an admin user has access to an individual record
Line 867: * @param ManagedAdminController $ctlr The controller which manages the table containing the record
Line 871: function checkRecordAccess(ManagedAdminController $ctlr, $item_id)
Line 896: * @param ManagedAdminController $ctlr
Line 898: private function cleanupCommonPostData(ManagedAdminController $ctlr)
Line 966: * @param string ManagedAdminController $ctlr The controller to check permissions for
Line 970: protected function perRecordPermissionsFields(ManagedAdminController $ctlr, $item_id)
Line 993: if (AdminPerms::canAccess('access_operators')) {
Line 994: $cat_list = AdminAuth::getAllCategories();
Line 997: $cat_ids = AdminAuth::getOperatorCategories();
Line 1014: // Don't display primary administrators category; they always get access
Line 1015: $primary_cat_id = AdminAuth::getPrimaryCategoryId();
Line 1021: // N.B. primary admins don't have any categories ticked because they belong to ALL categories,
Line 1024: if (!AdminAuth::inCategory($primary_cat_id)) {
Line 1031: if ($item_id == 0 or AdminAuth::inCategory($primary_cat_id)) {
Line 1035: // Hack in 'all operators' option for primary admins
Line 1036: if (AdminAuth::inCategory($primary_cat_id)) {
Line 1060: AdminAuth::checkLogin();
Line 1066: $view = new View('sprout/admin/main_layout');
Line 1072: if ($main instanceof AdminError) {
Line 1085: $class = 'admin-ajax action-add type-' . Enc::id($type);
Line 1088: echo '<form action="admin/add_save/' . Enc::html($ctlr->getControllerName()) . '" method="post">';
Line 1098: $tags = new View('sprout/admin/main_tags');
Line 1103: $tags->current_tags = @$_SESSION['admin']['tags'];
Line 1104: unset ($_SESSION['admin']['tags']);
Line 1108: $content = '<form action="admin/add_save/' . Enc::html($ctlr->getControllerName()) . '" method="post" id="edit-form" class="-clearfix">';
Line 1138: Form::setFieldValue('subsite_id', $_SESSION['admin']['active_subsite']);
Line 1176: AdminAuth::checkLogin();
Line 1185: $_SESSION['admin']['tags'] = $_POST['tags'];
Line 1206: Url::redirect("admin/add/{$type}");
Line 1211: unset ($_SESSION['admin']['tags']);
Line 1219: unset ($_SESSION['admin']['field_values']);
Line 1231: Url::redirect("admin/edit/{$type}/{$id}");
Line 1243: AdminAuth::checkLogin();
Line 1246: $view = new View('sprout/admin/main_layout');
Line 1258: if ($main instanceof AdminError) {
Line 1272: $tags = new View('sprout/admin/main_tags');
Line 1276: $tags->current_tags = @$_SESSION['admin']['tags'];
Line 1277: if (empty($_SESSION['admin']['tags'])) {
Line 1280: unset ($_SESSION['admin']['tags']);
Line 1283: $view->enable_seo = !empty(AdminSeo::$content)? true : false;
Line 1286: $content = '<form action="admin/edit_save/' . Enc::html($ctlr->getControllerName()) . '/' . $id;
Line 1291: $content .= AdminSeo::getAnalysis();
Line 1347: $view->live_url = Admin::ensureUrlAbsolute($url);
Line 1361: AdminAuth::checkLogin();
Line 1374: $_SESSION['admin']['tags'] = $_POST['tags'];
Line 1386: Url::redirect("admin/edit/{$type}/{$id}");
Line 1390: if ($result and AdminPerms::canAccess('access_operators')) {
Line 1396: unset ($_SESSION['admin']['tags']);
Line 1404: unset ($_SESSION['admin']['field_values']);
Line 1412: Url::redirect("admin/edit/{$type}/{$id}");
Line 1419: * @param string $type Shorthand controller name; see {@see Register::adminControllers}
Line 1424: AdminAuth::checkLogin();
Line 1433: if ($main instanceof AdminError) {
Line 1446: $view = new View('sprout/admin/main_layout');
Line 1451: $content = '<form action="admin/delete_save/' . Enc::html($ctlr->getControllerName()) . '/' . $id . '" method="post" id="edit-form">';
Line 1491: AdminAuth::checkLogin();
Line 1503: Url::redirect("admin/delete/{$type}/{$id}");
Line 1512: Url::redirect("admin/edit/{$type}/{$id}");
Line 1527: Url::redirect("admin/delete/{$type}/{$id}");
Line 1537: Url::redirect("admin/contents/{$type}");
Line 1551: AdminAuth::checkLogin();
Line 1554: $view = new View('sprout/admin/main_layout');
Line 1571: if ($main instanceof AdminError) {
Line 1583: $tags = new View('sprout/admin/main_tags');
Line 1588: $tags->current_tags = @$_SESSION['admin']['tags'];
Line 1589: if (empty($_SESSION['admin']['tags'])) {
Line 1592: unset ($_SESSION['admin']['tags']);
Line 1602: $content = '<form action="admin/duplicate_save/' . Enc::html($ctlr->getControllerName()) . '/' . $id . '" method="post" id="edit-form">';
Line 1663: AdminAuth::checkLogin();
Line 1675: $_SESSION['admin']['tags'] = $_POST['tags'];
Line 1728: Url::redirect("admin/duplicate/{$type}/{$orig_id}");
Line 1733: unset ($_SESSION['admin']['tags']);
Line 1741: unset ($_SESSION['admin']['field_values']);
Line 1743: Url::redirect("admin/edit/{$type}/{$id}");
Line 1752: AdminAuth::checkLogin();
Line 1754: $view = new View('sprout/admin/main_layout');
Line 1756: $this->setNavigation($view, new PageAdminController());
Line 1766: $out = '<form action="SITE/admin/moderate_action" method="post">';
Line 1820: AdminAuth::checkLogin();
Line 1853: Url::redirect('admin/moderate');
Line 1869: * class BookingAdminController extends ManagedAdminController {
Line 1870: * // Call with url admin/extra/booking/send_email/:record_id
Line 1876: * @param string $type The class name of the method to call (must extend ManagedAdminController)
Line 1882: AdminAuth::checkLogin();
Line 1902: $view = new View('sprout/admin/main_layout');
Line 1910: if ($main instanceof AdminError) {
Line 1930: * Directly calls a method provided by an admin controller
Line 1939: AdminAuth::checkLogin();
Line 1942: if (!$ctlr or !($ctlr instanceof ManagedAdminController)) {
Line 1963: * Sets the active subsite, and then redirects back to the admin area.
Line 1968: AdminAuth::checkLogin();
Line 1977: if (!AdminPerms::canAccessSubsite($_POST['subsite'])) {
Line 1979: Url::redirect(Kohana::config('sprout.admin_intro'));
Line 1982: $_SESSION['admin']['active_subsite'] = $_POST['subsite'];
Line 1985: Url::redirect(Kohana::config('sprout.admin_intro'));
Line 2015: $view->admin_authenticated = true;
Line 2029: $view->info_message = new View('sprout/admin/message_bad_browser');
Line 2035: if (!empty($_SESSION['admin'])) {
Line 2036: $view->live_url = Subsites::getAbsRoot($_SESSION['admin']['active_subsite']);
Line 2043: * @deprecated This function is now just an alias for {@see Admin::getController}
Line 2053: return Admin::getController($type);
Line 2060: * @param string $type Admin controller slug, e.g. 'page'
Line 2066: if (! Admin::locksEnabled()) return;
Line 2071: $lock = Admin::getLock($type, $id);
Line 2075: $lock_id = Admin::lock($type, $id);
Line 2083: } else if ($lock['lock_key'] == $_SESSION['admin']['lock_key']) {
Line 2085: Admin::pingLock($lock['id']);
Line 2105: Admin::unlock($type, $id);
Line 2115: AdminAuth::checkLogin();
Line 2121: Admin::unlock($_POST['ctlr'], $_POST['record_id']);
Line 2133: AdminAuth::checkLogin();
Line 2179: Url::redirect('admin/edit/action_log/' . $log_id);
Line 2182: $op = AdminAuth::getDetails();
Line 2191: Url::redirect('admin/edit/' . Enc::url($ctlr->getControllerName()) . '/' . $main_record['record_id']);
Line 2193: Url::redirect('admin/edit/action_log/' . $log_id);
Line 2317: AdminAuth::checkLogin();
Line 2324: Admin::pingLock($_GET['lock_id']);
Line 2325: Admin::clearOldLocks();

/sprout/Controllers/ContentSubscribeController.php   Highlighted file source

Line 20: use Sprout\Helpers\AdminAuth;
Line 316: AdminAuth::checkLogin();

/sprout/Controllers/ContentSubscribeController.php   Highlighted file source

Line 20: use Sprout\Helpers\AdminAuth;
Line 316: AdminAuth::checkLogin();

/sprout/Controllers/Controller.php   Highlighted file source

Line 21: use Sprout\Controllers\Admin\ManagedAdminController;
Line 24: use Sprout\Helpers\AdminAuth;
Line 118: $user_details = AdminAuth::getDetails();
Line 321: if ($this instanceof ManagedAdminController) {
Line 348: if ($this instanceof ManagedAdminController) {
Line 491: if ($this instanceof ManagedAdminController) {
Line 492: $session_key = 'admin';

/sprout/Controllers/Controller.php   Highlighted file source

Line 21: use Sprout\Controllers\Admin\ManagedAdminController;
Line 24: use Sprout\Helpers\AdminAuth;
Line 118: $user_details = AdminAuth::getDetails();
Line 321: if ($this instanceof ManagedAdminController) {
Line 348: if ($this instanceof ManagedAdminController) {
Line 491: if ($this instanceof ManagedAdminController) {
Line 492: $session_key = 'admin';

/sprout/Controllers/DbToolsController.php   Highlighted file source

Line 31: use Sprout\Helpers\Admin;
Line 32: use Sprout\Helpers\AdminAuth;
Line 95: [ 'url' => 'admin/extra/worker_job/manual_run', 'name' => 'Manual run worker job', 'desc' => 'Manually run a worker job in a browser' ],
Line 96: [ 'url' => 'admin/extra/cron_job/manual_run', 'name' => 'Manual run cron job', 'desc' => 'Manually run a cron job in a browser' ],
Line 97: [ 'url' => 'admin/style_guide', 'name' => 'Admin style guide', 'desc' => 'View styles of various admin features - form fields, etc' ],
Line 110: [ 'url' => 'admin/user-agent', 'name' => 'User agent tool', 'desc' => 'Show browser information<br><span>(this link doesn\'t require auth)</span>' ],
Line 117: [ 'url' => 'admin/intro/cron_job', 'name' => 'Cron job log', 'desc' => 'Cron (scheduled task) log' ],
Line 118: [ 'url' => 'admin/intro/worker_job', 'name' => 'Worker job log', 'desc' => 'Log of worker (background) processes' ],
Line 141: AdminAuth::checkLogin();
Line 142: if (AdminAuth::isSuper() !== true) {
Line 144: Url::redirect('admin');
Line 156: $path .= '/admin_load.php';
Line 198: $view = new View('sprout/admin/main_layout');
Line 707: AdminAuth::checkLogin();
Line 1321: AdminAuth::checkLogin();
Line 2189: if ($relative_name == '/admin_load.php') continue;
Line 2340: * The username and hash are used by {@see AdminAuth::processLocal}
Line 2365: $users = AdminAuth::injectLocalSuperConf($username, $data[0], $data[2]);
Line 2754: $op = AdminAuth::getDetails();
Line 2943: AdminAuth::checkLogin();
Line 2959: AdminAuth::checkLogin();

/sprout/Controllers/DbToolsController.php   Highlighted file source

Line 31: use Sprout\Helpers\Admin;
Line 32: use Sprout\Helpers\AdminAuth;
Line 95: [ 'url' => 'admin/extra/worker_job/manual_run', 'name' => 'Manual run worker job', 'desc' => 'Manually run a worker job in a browser' ],
Line 96: [ 'url' => 'admin/extra/cron_job/manual_run', 'name' => 'Manual run cron job', 'desc' => 'Manually run a cron job in a browser' ],
Line 97: [ 'url' => 'admin/style_guide', 'name' => 'Admin style guide', 'desc' => 'View styles of various admin features - form fields, etc' ],
Line 110: [ 'url' => 'admin/user-agent', 'name' => 'User agent tool', 'desc' => 'Show browser information<br><span>(this link doesn\'t require auth)</span>' ],
Line 117: [ 'url' => 'admin/intro/cron_job', 'name' => 'Cron job log', 'desc' => 'Cron (scheduled task) log' ],
Line 118: [ 'url' => 'admin/intro/worker_job', 'name' => 'Worker job log', 'desc' => 'Log of worker (background) processes' ],
Line 141: AdminAuth::checkLogin();
Line 142: if (AdminAuth::isSuper() !== true) {
Line 144: Url::redirect('admin');
Line 156: $path .= '/admin_load.php';
Line 198: $view = new View('sprout/admin/main_layout');
Line 707: AdminAuth::checkLogin();
Line 1321: AdminAuth::checkLogin();
Line 2189: if ($relative_name == '/admin_load.php') continue;
Line 2340: * The username and hash are used by {@see AdminAuth::processLocal}
Line 2365: $users = AdminAuth::injectLocalSuperConf($username, $data[0], $data[2]);
Line 2754: $op = AdminAuth::getDetails();
Line 2943: AdminAuth::checkLogin();
Line 2959: AdminAuth::checkLogin();

/sprout/Controllers/FileController.php   Highlighted file source

Line 21: use Sprout\Helpers\AdminAuth;
Line 355: AdminAuth::checkLogin();

/sprout/Controllers/FileController.php   Highlighted file source

Line 21: use Sprout\Helpers\AdminAuth;
Line 355: AdminAuth::checkLogin();

/sprout/Controllers/MediaMushController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 34: AdminAuth::checkLogin();

/sprout/Controllers/MediaMushController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 34: AdminAuth::checkLogin();

/sprout/Controllers/PageController.php   Highlighted file source

Line 22: use Sprout\Helpers\AdminAuth;
Line 168: * The revision must be live, or the user must be an administrator,
Line 200: AdminAuth::checkLogin();

/sprout/Controllers/PageController.php   Highlighted file source

Line 22: use Sprout\Helpers\AdminAuth;
Line 168: * The revision must be live, or the user must be an administrator,
Line 200: AdminAuth::checkLogin();

/sprout/Controllers/Tinymce4Controller.php   Highlighted file source

Line 20: use Sprout\Helpers\AdminAuth;
Line 21: use Sprout\Helpers\AdminPerms;
Line 75: $view->can_upload = AdminPerms::controllerAccess('file', 'add');
Line 92: AdminAuth::checkLogin();
Line 126: AdminAuth::checkLogin();
Line 164: AdminAuth::checkLogin();
Line 198: AdminAuth::checkLogin();
Line 246: AdminAuth::checkLogin();
Line 277: AdminAuth::checkLogin();
Line 329: AdminAuth::checkLogin();
Line 382: AdminAuth::checkLogin();
Line 416: AdminAuth::checkLogin();
Line 455: AdminAuth::checkLogin();
Line 489: AdminAuth::checkLogin();
Line 491: if (!AdminPerms::controllerAccess('file', 'add')) {
Line 528: AdminAuth::checkLogin();

/sprout/Controllers/Tinymce4Controller.php   Highlighted file source

Line 20: use Sprout\Helpers\AdminAuth;
Line 21: use Sprout\Helpers\AdminPerms;
Line 75: $view->can_upload = AdminPerms::controllerAccess('file', 'add');
Line 92: AdminAuth::checkLogin();
Line 126: AdminAuth::checkLogin();
Line 164: AdminAuth::checkLogin();
Line 198: AdminAuth::checkLogin();
Line 246: AdminAuth::checkLogin();
Line 277: AdminAuth::checkLogin();
Line 329: AdminAuth::checkLogin();
Line 382: AdminAuth::checkLogin();
Line 416: AdminAuth::checkLogin();
Line 455: AdminAuth::checkLogin();
Line 489: AdminAuth::checkLogin();
Line 491: if (!AdminPerms::controllerAccess('file', 'add')) {
Line 528: AdminAuth::checkLogin();

/sprout/Helpers/Admin.php   Highlighted file source

Line 33: * Useful functions for the admin
Line 35: class Admin
Line 66: if ($err instanceof AdminError) {
Line 87: public static function fieldError($field_name, $scope = 'admin')
Line 106: public static function clearFieldErrors($scope = 'admin')
Line 268: * @param int $subsite_id The subsite of pages to show. Defaults to the current admin subsite
Line 280: * Render a tree of nodes for the navigation area of the admin
Line 290: $admin_perms = AdminPerms::checkPermissionsTree('pages', $node['id']);
Line 295: $class .= ($admin_perms ? ' allow-access' : ' no-access');
Line 336: if (count($node->children) > 0 and $admin_perms) {
Line 479: echo '<p>ERROR: <code>Admin::setCategoryTablename()</code> has not been called.</p>';
Line 530: if (AdminPerms::controllerAccess($controller, 'categories')) {
Line 641: $.post(SITE + 'admin_ajax/attr_editor', {val:val, attr_name:$(this).val()}, function(data) {
Line 672: if (!AdminAuth::isLoggedIn()) return;
Line 676: if (AdminPerms::controllerAccess('page', 'contents')) {
Line 677: $dashboard_url = Enc::html(Kohana::config('sprout.admin_intro'));
Line 685: echo '<li class="depth-1 on"><a href="admin/intro/page">Pages</a></li>';
Line 687: echo '<li class="depth-1"><a href="admin/intro/page">Pages</a></li>';
Line 691: if (AdminPerms::controllerAccess('file', 'contents')) {
Line 693: echo '<li class="depth-1 on"><a href="admin/intro/file">Media</a></li>';
Line 695: echo '<li class="depth-1"><a href="admin/intro/file">Media</a></li>';
Line 699: if (Register::hasFeature('users') and AdminPerms::controllerAccess('user', 'contents')) {
Line 701: echo '<li class="depth-1 on"><a href="admin/intro/user">Users</a></li>';
Line 703: echo '<li class="depth-1"><a href="admin/intro/user">Users</a></li>';
Line 707: $tiles = Register::getAdminTiles();
Line 708: $tiles = AdminPerms::filterAdminTiles($tiles);
Line 752: echo '<li><a href="admin/intro/', Enc::html($ctlr), '">', Enc::html($name), '</a></li>';
Line 773: * When in the admin, return the slug of the controller being used, e.g. 'page' or 'blog_post'
Line 788: * When in the admin, return the record id being added or edited.
Line 790: * If used outside of the admin, behaviour is undefined
Line 809: $op_id = AdminAuth::getLocalId();
Line 827: $op_id = AdminAuth::getLocalId();
Line 836: * Is admin locks enabled?
Line 842: $conf = Kohana::config('sprout.admin_locks');
Line 860: FROM ~admin_locks
Line 871: Admin::forceUnlock($row['id']);
Line 888: $op = AdminAuth::getDetails();
Line 890: if (! $_SESSION['admin']['lock_key']) {
Line 891: $_SESSION['admin']['lock_key'] = Admin::createLockKey();
Line 900: $update_data['lock_key'] = $_SESSION['admin']['lock_key'];
Line 905: $lock_id = Pdb::insert('admin_locks', $update_data);
Line 924: Pdb::update('admin_locks', $update_data, ['id' => $lock_id]);
Line 933: Pdb::delete('admin_locks', ['id' => (int) $lock_id]);
Line 945: if (empty($_SESSION['admin']['lock_key'])) {
Line 949: $where = ['lock_key' => $_SESSION['admin']['lock_key']];
Line 955: Pdb::delete('admin_locks', $where);
Line 974: $q = "SELECT id, date_modified FROM ~admin_locks";
Line 979: Admin::forceUnlock($row['id']);
Line 988: * Gets an instance of a managed admin controller
Line 991: * e.g. 'Sprout\Controllers\Admin\AwesomeAdminController' or 'awesome'
Line 992: * @return ManagedAdminController
Line 1002: $full_name = Register::getAdminController($class_name);
Line 1007: if (substr($full_name, -15) != 'AdminController') {
Line 1008: $full_name .= 'AdminController';
Line 1010: $full_name = 'Sprout\\Controllers\\Admin\\' . $full_name;
Line 1016: 'Sprout\\Controllers\\Admin\\ManagedAdminController'
Line 1025: * If it's not absolute, the current admin abs-root is prepended
Line 1035: return Subsites::getAbsRoot($_SESSION['admin']['active_subsite']) . ltrim($url, '/');

/sprout/Helpers/AdminAuth.php   Highlighted file source

Line 24: * Provides user authentication functions for the admin
Line 26: class AdminAuth extends Auth
Line 28: const KEY = 'admin';
Line 29: const LOGIN_URL = 'admin/login';
Line 44: if (Router::$controller == 'admin' and Router::$method == 'index') {
Line 48: if ($redirect && $redirect !== "admin") Notification::error('You need to be logged in to access this part of the site');
Line 85: $admin = Pdb::q($q, [Pdb::likeEscape($username)], 'row');
Line 95: $ip_lists = Pdb::q($q, [$admin['id']], 'col');
Line 106: if (! AdminAuth::checkAlgorithm($admin['algorithm'])) {
Line 112: if (!self::doPasswordCheck($admin['password'], $admin['algorithm'], $admin['salt'], $password)) {
Line 117: if ($admin['tfa_method'] !== 'none') {
Line 118: $_SESSION[self::KEY]['tfa_id'] = $admin['id'];
Line 120: $_SESSION[self::KEY]['login_id'] = $admin['id'];
Line 125: $_SESSION[self::KEY]['lock_key'] = Admin::createLockKey();
Line 129: if ($admin['algorithm'] != $default_algorithm) {
Line 130: self::changePassword($password, $admin['id']);
Line 207: $_SESSION[self::KEY]['lock_key'] = Admin::createLockKey();
Line 276: // $_SESSION[self::KEY]['lock_key'] = Admin::createLockKey();
Line 313: * Does a rate-limit check for admin logins against the login_attempts table
Line 410: // This has not been implemented. See {@see AdminAuth::processRemote} for more info
Line 475: * Gets a list of all of the admin categories
Line 510: * Get the ID of the 'Primary administrators' category

/sprout/Helpers/AdminDashboard.php   Highlighted file source

Line 20: * Dashboard shown when a user first logs in to the admin
Line 22: class AdminDashboard
Line 26: * Render the admin dashboard
Line 35: if (AdminPerms::canAccess('access_noapproval')) {
Line 47: * Show the "first run" message, which welcomes new operators to the admin
Line 53: if (!AdminAuth::hasDatabaseRecord()) {
Line 58: $firstrun = Pdb::query($q, [AdminAuth::getId()], 'val');
Line 63: $view = new View('sprout/admin/dashboard/first_run');
Line 93: $params[] = "SITE/admin/edit/{$controller}/";
Line 133: $params = ['need_approval', $_SESSION['admin']['active_subsite']];
Line 149: $itemlist->addAction('edit', 'SITE/admin/edit/page/%%#main-tabs-revs');
Line 183: $view = new View('sprout/admin/dashboard/moderation_button');

/sprout/Helpers/AdminError.php   Highlighted file source

Line 17: * Handles errors in the admin.
Line 20: class AdminError

/sprout/Helpers/AdminError.php   Highlighted file source

Line 17: * Handles errors in the admin.
Line 20: class AdminError

/sprout/Helpers/AdminPerms.php   Highlighted file source

Line 23: * Provides user permisison functions for the admin
Line 25: class AdminPerms
Line 44: if (! $_SESSION['admin']['login_id']) return false;
Line 47: if ($_SESSION['admin']['super']) return true;
Line 55: $conditions = ['operator_id' => $_SESSION['admin']['login_id'], ['cat_id', 'IN', $access_groups]];
Line 74: * $cat_ids = AdminPerms::getAccessableGroups('pages', 10);
Line 85: return array_keys(AdminAuth::getAllCategories());
Line 90: $q = "SELECT tbl.parent_id, tbl.admin_perm_type, perms.category_id
Line 92: LEFT JOIN ~{$single}_admin_permissions AS perms ON perms.item_id = tbl.id
Line 101: switch ($res[0]['admin_perm_type']) {
Line 140: if (empty($_SESSION['admin']['login_id'])) return;
Line 143: if ($_SESSION['admin']['super']) {
Line 157: $res = Pdb::q($q, [$_SESSION['admin']['login_id']], 'pdo');
Line 201: if (empty($_SESSION['admin']['login_id'])) return self::$subsites_permitted;
Line 204: if (isset($_SESSION['admin']['super'])) {
Line 216: $cats = array_merge($cats, AdminAuth::getOperatorCategories());
Line 221: $admin_id = AdminAuth::getId();
Line 294: if (! $_SESSION['admin']['login_id']) return false;
Line 295: if ($_SESSION['admin']['super']) return true;
Line 300: return AdminPerms::canAccess('access_homepage');
Line 309: return AdminPerms::canAccess('access_operators');
Line 319: $res = Pdb::q($q, [AdminAuth::getId()], 'arr');
Line 365: if (! $_SESSION['admin']['login_id']) return array();
Line 366: if ($_SESSION['admin']['super']) return $controllers;
Line 374: $res = Pdb::q($q, [AdminAuth::getId()], 'arr');
Line 430: $controller_names = array_keys(Register::getAdminControllers());
Line 435: $allowed_ctlrs = AdminPerms::controllerAccessMulti($controller_names);
Line 444: * @param array Tile definitions, loaded from {@see Register::getAdminTiles}
Line 447: public static function filterAdminTiles(array $tiles)
Line 451: if (!AdminPerms::controllerAccess($ctlr, 'contents')) {
Line 470: if (! AdminAuth::isLoggedIn()) {
Line 476: if (AdminPerms::canAccess('access_operators')) {
Line 494: return Pdb::q($q, [AdminAuth::getId()], 'map');
Line 503: if (! AdminAuth::isLoggedIn()) {
Line 507: if (AdminPerms::canAccess('access_operators')) {

/sprout/Helpers/AdminPerms.php   Highlighted file source

Line 23: * Provides user permisison functions for the admin
Line 25: class AdminPerms
Line 44: if (! $_SESSION['admin']['login_id']) return false;
Line 47: if ($_SESSION['admin']['super']) return true;
Line 55: $conditions = ['operator_id' => $_SESSION['admin']['login_id'], ['cat_id', 'IN', $access_groups]];
Line 74: * $cat_ids = AdminPerms::getAccessableGroups('pages', 10);
Line 85: return array_keys(AdminAuth::getAllCategories());
Line 90: $q = "SELECT tbl.parent_id, tbl.admin_perm_type, perms.category_id
Line 92: LEFT JOIN ~{$single}_admin_permissions AS perms ON perms.item_id = tbl.id
Line 101: switch ($res[0]['admin_perm_type']) {
Line 140: if (empty($_SESSION['admin']['login_id'])) return;
Line 143: if ($_SESSION['admin']['super']) {
Line 157: $res = Pdb::q($q, [$_SESSION['admin']['login_id']], 'pdo');
Line 201: if (empty($_SESSION['admin']['login_id'])) return self::$subsites_permitted;
Line 204: if (isset($_SESSION['admin']['super'])) {
Line 216: $cats = array_merge($cats, AdminAuth::getOperatorCategories());
Line 221: $admin_id = AdminAuth::getId();
Line 294: if (! $_SESSION['admin']['login_id']) return false;
Line 295: if ($_SESSION['admin']['super']) return true;
Line 300: return AdminPerms::canAccess('access_homepage');
Line 309: return AdminPerms::canAccess('access_operators');
Line 319: $res = Pdb::q($q, [AdminAuth::getId()], 'arr');
Line 365: if (! $_SESSION['admin']['login_id']) return array();
Line 366: if ($_SESSION['admin']['super']) return $controllers;
Line 374: $res = Pdb::q($q, [AdminAuth::getId()], 'arr');
Line 430: $controller_names = array_keys(Register::getAdminControllers());
Line 435: $allowed_ctlrs = AdminPerms::controllerAccessMulti($controller_names);
Line 444: * @param array Tile definitions, loaded from {@see Register::getAdminTiles}
Line 447: public static function filterAdminTiles(array $tiles)
Line 451: if (!AdminPerms::controllerAccess($ctlr, 'contents')) {
Line 470: if (! AdminAuth::isLoggedIn()) {
Line 476: if (AdminPerms::canAccess('access_operators')) {
Line 494: return Pdb::q($q, [AdminAuth::getId()], 'map');
Line 503: if (! AdminAuth::isLoggedIn()) {
Line 507: if (AdminPerms::canAccess('access_operators')) {

/sprout/Helpers/AdminSeo.php   Highlighted file source

Line 32: class AdminSeo
Line 111: $expr = '/\b(' . implode('|', Kohana::config('admin_seo.stop_words')) . ')\b/i';
Line 217: return in_array($word, Kohana::config('admin_seo.stop_words'));
Line 269: $view = new View('sprout/admin/main_seo');
Line 282: $view = new View('sprout/admin/main_seo');
Line 302: $ratings = Kohana::config('admin_seo.readability_scores');
Line 329: $score = Kohana::config('admin_seo.word_count');
Line 347: $words = Kohana::config('admin_seo.average_words_sentence');
Line 531: $score = Kohana::config('admin_seo.word_count');

/sprout/Helpers/ColModifier.php   Highlighted file source

Line 19: * e.g. in {@see ManagedAdminController::_getContents}

/sprout/Helpers/ColModifier.php   Highlighted file source

Line 19: * e.g. in {@see ManagedAdminController::_getContents}

/sprout/Helpers/Cron.php   Highlighted file source

Line 43: // Require admin auth for browser-based requests. These *should* be tunneled via
Line 44: // the CronJobAdminController's UI but it's possible to call the methods directly
Line 48: AdminAuth::checkLogin();

/sprout/Helpers/Itemlist.php   Highlighted file source

Line 23: * This is usually used for the admin/contents/* route which provides the main
Line 24: * UI to operators for a given {@see ManagedAdminController}

/sprout/Helpers/JsonForm.php   Highlighted file source

Line 23: * A generic implementation which should work for most cases is found in {@see ManagedAdminController::_getEditForm}

/sprout/Helpers/LinkSpecExternal.php   Highlighted file source

Line 61: return new AdminError('External links must begin with "http://" or "https://"');

/sprout/Helpers/LinkSpecExternal.php   Highlighted file source

Line 61: return new AdminError('External links must begin with "http://" or "https://"');

/sprout/Helpers/Locales/LocaleInfoPAK.php   Highlighted file source

Line 30: 'TA' => 'Federally Administered Tribal Areas',

/sprout/Helpers/Locales/LocaleInfoPAK.php   Highlighted file source

Line 30: 'TA' => 'Federally Administered Tribal Areas',

/sprout/Helpers/NavigationGroups.php   Highlighted file source

Line 66: * ADMIN ONLY METHOD
Line 71: public static function getGroupsAdmin($page_id)
Line 73: $names = self::loadGroupNames($_SESSION['admin']['active_subsite']);
Line 75: $groups = Subsites::getConfigAdmin('nav_groups');
Line 93: $update_data['subsite_id'] = (int)$_SESSION['admin']['active_subsite'];
Line 116: * ADMIN ONLY METHOD
Line 118: public static function getAllGroupsAdmin()
Line 120: $groups = Subsites::getConfigAdmin('nav_groups');
Line 124: $all_groups[$page_id] = self::getGroupsAdmin($page_id);
Line 133: * ADMIN ONLY METHOD
Line 135: public static function getAllNamesAdmin()
Line 137: $groups = Subsites::getConfigAdmin('nav_groups');
Line 141: $groups = self::getGroupsAdmin($page_id);
Line 218: * ADMIN ONLY METHOD
Line 220: public static function getAllExtrasAdmin() {
Line 221: self::loadGroupNames($_SESSION['admin']['active_subsite']);
Line 222: return self::$extras[$_SESSION['admin']['active_subsite']];

/sprout/Helpers/Needs.php   Highlighted file source

Line 109: * If 'sprout/admin_layout' is requested, the following two files will be included, if they are found:
Line 110: * - sprout/media/css/admin_layout.css
Line 111: * - sprout/media/js/admin_layout.min.js OR sprout/media/js/admin_layout.js
Line 117: * @param string $name The name of the file group, e.g. 'Forms/admin_fields'
Line 124: if (Router::$controller != 'Sprout\\Controllers\\AdminController' and @in_array($name, is_array(Kohana::config('sprout.dont_need'))? Kohana::config('sprout.dont_need') : [])) return;
Line 126: if (Router::$controller != 'Sprout\\Controllers\\AdminController' and in_array($name, Kohana::config('sprout.dont_need') ?? [])) return;

/sprout/Helpers/Needs.php   Highlighted file source

Line 109: * If 'sprout/admin_layout' is requested, the following two files will be included, if they are found:
Line 110: * - sprout/media/css/admin_layout.css
Line 111: * - sprout/media/js/admin_layout.min.js OR sprout/media/js/admin_layout.js
Line 117: * @param string $name The name of the file group, e.g. 'Forms/admin_fields'
Line 124: if (Router::$controller != 'Sprout\\Controllers\\AdminController' and @in_array($name, is_array(Kohana::config('sprout.dont_need'))? Kohana::config('sprout.dont_need') : [])) return;
Line 126: if (Router::$controller != 'Sprout\\Controllers\\AdminController' and in_array($name, Kohana::config('sprout.dont_need') ?? [])) return;

/sprout/Helpers/PerRecordPerms.php   Highlighted file source

Line 16: use Sprout\Controllers\Admin\ManagedAdminController;
Line 28: * @param ManagedAdminController $ctlr The controller to check
Line 31: public static function controllerRestricted(ManagedAdminController $ctlr)
Line 43: * @param ManagedAdminController $ctlr The controller to check
Line 46: public static function hasRecordPerms(ManagedAdminController $ctlr)
Line 56: * Gets a clause to restrict a query to the set of categories the current admin belongs to
Line 62: $operator_cats = AdminAuth::getOperatorCategories();
Line 78: * @param ManagedAdminController $ctlr Admin controller for the record in question
Line 85: public static function fetchDetails(ManagedAdminController $ctlr, $item_id)
Line 105: * @param ManagedAdminController $ctlr Admin controller for the record in question
Line 109: public static function save(ManagedAdminController $ctlr, $item_id)
Line 120: if (AdminPerms::canAccess('access_operators')) {
Line 121: $all_cat_ids = array_keys(AdminAuth::getAllCategories());
Line 123: $all_cat_ids = AdminAuth::getOperatorCategories();
Line 131: // Always include primary administrators
Line 133: $cat_ids[] = AdminAuth::getPrimaryCategoryId();
Line 139: if (AdminPerms::canAccess('access_operators') and !empty($_POST['_prm_all_cats'])) {

/sprout/Helpers/PerRecordPerms.php   Highlighted file source

Line 16: use Sprout\Controllers\Admin\ManagedAdminController;
Line 28: * @param ManagedAdminController $ctlr The controller to check
Line 31: public static function controllerRestricted(ManagedAdminController $ctlr)
Line 43: * @param ManagedAdminController $ctlr The controller to check
Line 46: public static function hasRecordPerms(ManagedAdminController $ctlr)
Line 56: * Gets a clause to restrict a query to the set of categories the current admin belongs to
Line 62: $operator_cats = AdminAuth::getOperatorCategories();
Line 78: * @param ManagedAdminController $ctlr Admin controller for the record in question
Line 85: public static function fetchDetails(ManagedAdminController $ctlr, $item_id)
Line 105: * @param ManagedAdminController $ctlr Admin controller for the record in question
Line 109: public static function save(ManagedAdminController $ctlr, $item_id)
Line 120: if (AdminPerms::canAccess('access_operators')) {
Line 121: $all_cat_ids = array_keys(AdminAuth::getAllCategories());
Line 123: $all_cat_ids = AdminAuth::getOperatorCategories();
Line 131: // Always include primary administrators
Line 133: $cat_ids[] = AdminAuth::getPrimaryCategoryId();
Line 139: if (AdminPerms::canAccess('access_operators') and !empty($_POST['_prm_all_cats'])) {

/sprout/Helpers/Preview.php   Highlighted file source

Line 18: use Sprout\Controllers\Admin\ManagedAdminController;
Line 33: * @param ManagedAdminController $ctlr The controller with the preview method
Line 45: public static function load(ManagedAdminController $ctlr, array $tables, $record_id = 0)
Line 48: $subsite = (int) $_SESSION['admin']['active_subsite'];
Line 103: unset($_SESSION['admin']['field_values']);
Line 104: unset($_SESSION['admin']['field_errors']);

/sprout/Helpers/Preview.php   Highlighted file source

Line 18: use Sprout\Controllers\Admin\ManagedAdminController;
Line 33: * @param ManagedAdminController $ctlr The controller with the preview method
Line 45: public static function load(ManagedAdminController $ctlr, array $tables, $record_id = 0)
Line 48: $subsite = (int) $_SESSION['admin']['active_subsite'];
Line 103: unset($_SESSION['admin']['field_values']);
Line 104: unset($_SESSION['admin']['field_errors']);

/sprout/Helpers/Register.php   Highlighted file source

Line 38: private static $admin_controllers = [];
Line 39: private static $admin_tiles = [];
Line 208: * @param array $field_defs An array of name => description field definitions, for the admin
Line 291: self::$admin_controllers['document_type'] = '\\Sprout\\Controllers\\Admin\\DocumentTypeAdminController';
Line 292: self::$admin_controllers['email_text'] = '\\Sprout\\Controllers\\Admin\\EmailTextAdminController';
Line 293: self::$admin_controllers['extra_page'] = '\\Sprout\\Controllers\\Admin\\ExtraPageAdminController';
Line 294: self::$admin_controllers['file'] = '\\Sprout\\Controllers\\Admin\\FileAdminController';
Line 295: self::$admin_controllers['page'] = '\\Sprout\\Controllers\\Admin\\PageAdminController';
Line 296: self::$admin_controllers['redirect'] = '\\Sprout\\Controllers\\Admin\\RedirectAdminController';
Line 301: * Registers a module's shorthand controller names for the admin controller
Line 303: * name but not 'Controllers' segment, e.g. Karmabunny\HomePage\Admin
Line 305: * names within the specified namespace, e.g. ['home' => 'Admin\HomePageAdminController']
Line 307: public static function adminControllers($namespace, array $controllers)
Line 314: if (isset(self::$admin_controllers[$shorthand])) {
Line 318: self::$admin_controllers[$shorthand] = $full_class;
Line 323: * Converts an shorthand admin controller name to its full class name,
Line 328: public static function getAdminController($shorthand)
Line 330: if (!isset(self::$admin_controllers[$shorthand])) {
Line 333: return self::$admin_controllers[$shorthand];
Line 337: * Gets the list of modular admin controllers with registered shorthands
Line 340: public static function getAdminControllers()
Line 342: return self::$admin_controllers;
Line 347: * Register a "tile", which is shown in the modules menu in the admin
Line 357: public static function adminTile($name, $icon, $text, array $controllers, $sort_order = 10)
Line 359: $hidden = \Kohana::config('sprout.admin_tile_hidden');
Line 360: if (AdminAuth::isSuper()) {
Line 372: self::$admin_tiles[$sort_order . $name] = [
Line 382: * Return an array of admin tiles.
Line 387: public static function getAdminTiles()
Line 389: return self::$admin_tiles;
Line 542: * Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronPageActivate');

/sprout/Helpers/Register.php   Highlighted file source

Line 38: private static $admin_controllers = [];
Line 39: private static $admin_tiles = [];
Line 208: * @param array $field_defs An array of name => description field definitions, for the admin
Line 291: self::$admin_controllers['document_type'] = '\\Sprout\\Controllers\\Admin\\DocumentTypeAdminController';
Line 292: self::$admin_controllers['email_text'] = '\\Sprout\\Controllers\\Admin\\EmailTextAdminController';
Line 293: self::$admin_controllers['extra_page'] = '\\Sprout\\Controllers\\Admin\\ExtraPageAdminController';
Line 294: self::$admin_controllers['file'] = '\\Sprout\\Controllers\\Admin\\FileAdminController';
Line 295: self::$admin_controllers['page'] = '\\Sprout\\Controllers\\Admin\\PageAdminController';
Line 296: self::$admin_controllers['redirect'] = '\\Sprout\\Controllers\\Admin\\RedirectAdminController';
Line 301: * Registers a module's shorthand controller names for the admin controller
Line 303: * name but not 'Controllers' segment, e.g. Karmabunny\HomePage\Admin
Line 305: * names within the specified namespace, e.g. ['home' => 'Admin\HomePageAdminController']
Line 307: public static function adminControllers($namespace, array $controllers)
Line 314: if (isset(self::$admin_controllers[$shorthand])) {
Line 318: self::$admin_controllers[$shorthand] = $full_class;
Line 323: * Converts an shorthand admin controller name to its full class name,
Line 328: public static function getAdminController($shorthand)
Line 330: if (!isset(self::$admin_controllers[$shorthand])) {
Line 333: return self::$admin_controllers[$shorthand];
Line 337: * Gets the list of modular admin controllers with registered shorthands
Line 340: public static function getAdminControllers()
Line 342: return self::$admin_controllers;
Line 347: * Register a "tile", which is shown in the modules menu in the admin
Line 357: public static function adminTile($name, $icon, $text, array $controllers, $sort_order = 10)
Line 359: $hidden = \Kohana::config('sprout.admin_tile_hidden');
Line 360: if (AdminAuth::isSuper()) {
Line 372: self::$admin_tiles[$sort_order . $name] = [
Line 382: * Return an array of admin tiles.
Line 387: public static function getAdminTiles()
Line 389: return self::$admin_tiles;
Line 542: * Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronPageActivate');

/sprout/Helpers/Router.php   Highlighted file source

Line 285: * @param string URI to convert, e.g. 'admin/edit/page/3'
Line 286: * @return string|bool Routed URI or false, e.g. 'AdminController/edit/page/3'

/sprout/Helpers/Router.php   Highlighted file source

Line 285: * @param string URI to convert, e.g. 'admin/edit/page/3'
Line 286: * @return string|bool Routed URI or false, e.g. 'AdminController/edit/page/3'

/sprout/Helpers/Skin.php   Highlighted file source

Line 209: if ($unavail and !AdminAuth::isLoggedIn()) {

/sprout/Helpers/Sprout.php   Highlighted file source

Line 768: * Return a list of admins to send emails to.
Line 773: public static function adminEmails()
Line 777: $ops = AdminPerms::getOperatorsWithAccess('access_reportemail');

/sprout/Helpers/SproutVariable.php   Highlighted file source

Line 46: public $admin;
Line 66: $this->admin = new AdminAuth();

/sprout/Helpers/Subsites.php   Highlighted file source

Line 71: * Determines if multiple subsites can be accessed by the currently logged in administrator
Line 78: AdminAuth::checkLogin();
Line 82: if (AdminPerms::canAccessSubsite($sub['id'])) $count++;
Line 90: * Outputs a select UL for choosing a subsite from within the admin area
Line 97: AdminAuth::checkLogin();
Line 99: echo '<form action="admin/set_active_subsite" method="post">';
Line 109: if (AdminPerms::canAccessSubsite($site['id'])) {
Line 148: if (AdminPerms::canAccessSubsite($sub['id'])) return $sub['id'];
Line 248: * Returns the abs root (including protocol and server name) of the current admin subsite
Line 250: public static function getAbsRootAdmin()
Line 252: AdminAuth::checkLogin();
Line 253: return self::getAbsRoot(@$_SESSION['admin']['active_subsite']);
Line 281: * Admin version of the getConfig function, uses the currently active subsite
Line 283: public static function getConfigAdmin($key)
Line 285: AdminAuth::checkLogin();
Line 286: return self::getConfig($key, @$_SESSION['admin']['active_subsite']);

/sprout/Helpers/SubsiteSelector.php   Highlighted file source

Line 39: $q = "SELECT id, content_id, code, mobile, cond_domain, cond_directory, require_admin, require_user
Line 52: if (!preg_match('!^(admin|admin_ajax|testing|dbtools)!', Router::$current_uri)) {
Line 99: // If admin access is required to view the subsite
Line 100: if ($row['require_admin']) {
Line 101: if (! AdminAuth::isLoggedIn()) continue;
Line 117: // Check admin or user auth requirements for default subsite
Line 118: if (!AdminAuth::isLoggedIn() and PHP_SAPI !== 'cli') {
Line 119: if ($default['require_admin'] and !preg_match('!^(admin|admin_ajax|file)/!', Router::$current_uri)) {
Line 120: AdminAuth::checkLogin();
Line 130: if (!preg_match('!^(admin|admin_ajax|testing|dbtools)!', Router::$current_uri)) {

/sprout/Helpers/SubsiteSelector.php   Highlighted file source

Line 39: $q = "SELECT id, content_id, code, mobile, cond_domain, cond_directory, require_admin, require_user
Line 52: if (!preg_match('!^(admin|admin_ajax|testing|dbtools)!', Router::$current_uri)) {
Line 99: // If admin access is required to view the subsite
Line 100: if ($row['require_admin']) {
Line 101: if (! AdminAuth::isLoggedIn()) continue;
Line 117: // Check admin or user auth requirements for default subsite
Line 118: if (!AdminAuth::isLoggedIn() and PHP_SAPI !== 'cli') {
Line 119: if ($default['require_admin'] and !preg_match('!^(admin|admin_ajax|file)/!', Router::$current_uri)) {
Line 120: AdminAuth::checkLogin();
Line 130: if (!preg_match('!^(admin|admin_ajax|testing|dbtools)!', Router::$current_uri)) {

/sprout/Helpers/TinyMCE4RichText.php   Highlighted file source

Line 72: if (Router::$controller == 'admin') {
Line 73: $subsite = @$_SESSION['admin']['active_subsite'];
Line 74: $options['document_base_url'] = rtrim(Subsites::getAbsRootAdmin(), '/') . '/';

/sprout/Helpers/Widgets.php   Highlighted file source

Line 109: if ($orientation != WidgetArea::ORIENTATION_EMAIL and AdminAuth::isLoggedIn()) {
Line 155: * Render extra widget info for admins

/sprout/Helpers/WorkerLinkChecker.php   Highlighted file source

Line 121: $ops = AdminPerms::getOperatorsWithAccess('access_reportemail');

/sprout/module_template/has_categories/admin_load.php   Highlighted file source

Line 17: Register::adminControllers('AUTHOR\MODULE', [
Line 18: 'SNAME' => 'Admin\CNAMEAdminController',
Line 19: 'SNAME_category' => 'Admin\CNAMECategoryAdminController',
Line 22: Register::adminTile(

/sprout/module_template/has_categories/Controllers/Admin/CNAMEAdminController.php   Highlighted file source

Line 14: namespace SproutModules\AUTHOR\MODULE\Controllers\Admin;
Line 18: use Sprout\Controllers\Admin\HasCategoriesAdminController;
Line 23: * Handles admin processing for PNICE
Line 25: class CNAMEAdminController extends HasCategoriesAdminController
Line 61: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 94: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}

/sprout/module_template/has_categories/Controllers/Admin/CNAMECategoryAdminController.php   Highlighted file source

Line 14: namespace SproutModules\AUTHOR\MODULE\Controllers\Admin;
Line 16: use Sprout\Controllers\Admin\CategoryAdminController;
Line 22: class CNAMECategoryAdminController extends CategoryAdminController

/sprout/module_template/list/admin_load.php   Highlighted file source

Line 17: Register::adminControllers('AUTHOR\MODULE', [
Line 18: 'SNAME' => 'Admin\CNAMEAdminController',
Line 21: Register::adminTile(

/sprout/module_template/list/Controllers/Admin/CNAMEAdminController.php   Highlighted file source

Line 14: namespace SproutModules\AUTHOR\MODULE\Controllers\Admin;
Line 18: use Sprout\Controllers\Admin\ListAdminController;
Line 24: * Handles admin processing for PNICE
Line 26: class CNAMEAdminController extends ListAdminController
Line 62: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 100: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}

/sprout/module_template/tree/admin_load.php   Highlighted file source

Line 17: Register::adminControllers('AUTHOR\MODULE', [
Line 18: 'SNAME' => 'Admin\CNAMEAdminController',
Line 21: Register::adminTile(

/sprout/module_template/tree/Controllers/Admin/CNAMEAdminController.php   Highlighted file source

Line 14: namespace SproutModules\AUTHOR\MODULE\Controllers\Admin;
Line 18: use Sprout\Controllers\Admin\TreeAdminController;
Line 24: * Handles admin processing for PNICE
Line 26: class CNAMEAdminController extends TreeAdminController
Line 62: * Return the sub-actions for adding; for spec {@see AdminController::renderSubActions}
Line 100: * Return the sub-actions for editing; for spec {@see AdminController::renderSubActions}

/sprout/sprout_load.php   Highlighted file source

Line 24: Register::extraPage(2, 'Admin login message');
Line 27: Register::pageattr('sprout.admin_notes', 'Admin notes', 'AttrEditorMultiline');
Line 55: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronPageActivate');
Line 56: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronPageDeactivate');
Line 57: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronCheckStale');
Line 58: Register::cronJob('daily', 'Sprout\\Controllers\\AdminController', 'cronGenericActivate');
Line 59: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\FileAdminController', 'cronCleanupInvalid');
Line 61: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\ActionLogAdminController', 'cronCleanup');

/sprout/sprout_load.php   Highlighted file source

Line 24: Register::extraPage(2, 'Admin login message');
Line 27: Register::pageattr('sprout.admin_notes', 'Admin notes', 'AttrEditorMultiline');
Line 55: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronPageActivate');
Line 56: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronPageDeactivate');
Line 57: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronCheckStale');
Line 58: Register::cronJob('daily', 'Sprout\\Controllers\\AdminController', 'cronGenericActivate');
Line 59: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\FileAdminController', 'cronCleanupInvalid');
Line 61: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\ActionLogAdminController', 'cronCleanup');

/sprout/tests/adminPermsTest.php   Highlighted file source

Line 14: use Sprout\Helpers\AdminPerms;
Line 19: class adminPermsTest extends PHPUnit_Framework_TestCase
Line 30: ['id' => 1, 'parent_id' => 0, 'admin_perm_type' => Constants::PERM_INHERIT], // top-level, all
Line 31: ['id' => 2, 'parent_id' => 1, 'admin_perm_type' => Constants::PERM_INHERIT], // inherit, all
Line 32: ['id' => 3, 'parent_id' => 1, 'admin_perm_type' => Constants::PERM_SPECIFIC], // no perms
Line 33: ['id' => 4, 'parent_id' => 1, 'admin_perm_type' => Constants::PERM_SPECIFIC], // group 1
Line 34: ['id' => 5, 'parent_id' => 1, 'admin_perm_type' => Constants::PERM_SPECIFIC], // group 2
Line 36: ['id' => 6, 'parent_id' => 0, 'admin_perm_type' => Constants::PERM_SPECIFIC], // top-level, none
Line 37: ['id' => 7, 'parent_id' => 6, 'admin_perm_type' => Constants::PERM_INHERIT], // inherit, none
Line 38: ['id' => 8, 'parent_id' => 6, 'admin_perm_type' => Constants::PERM_SPECIFIC], // specific, group 1
Line 40: ['id' => 9, 'parent_id' => 0, 'admin_perm_type' => Constants::PERM_SPECIFIC], // top-level, group 1
Line 41: ['id' => 10,'parent_id' => 9, 'admin_perm_type' => Constants::PERM_INHERIT], // inherit, group 1
Line 42: ['id' => 11,'parent_id' => 9, 'admin_perm_type' => Constants::PERM_SPECIFIC], // specific, group 2
Line 59: Pdb::query('CREATE TABLE ~pages (id INT, parent_id INT, admin_perm_type INT)', [], 'null');
Line 69: Pdb::query('CREATE TABLE ~page_admin_permissions (item_id INT, category_id INT)', [], 'null');
Line 71: Pdb::insert('page_admin_permissions', $row);
Line 106: $this->assertEquals($expected, AdminPerms::getAccessableGroups('pages', $page_id));

/sprout/tests/adminPermsTest.php   Highlighted file source

Line 14: use Sprout\Helpers\AdminPerms;
Line 19: class adminPermsTest extends PHPUnit_Framework_TestCase
Line 30: ['id' => 1, 'parent_id' => 0, 'admin_perm_type' => Constants::PERM_INHERIT], // top-level, all
Line 31: ['id' => 2, 'parent_id' => 1, 'admin_perm_type' => Constants::PERM_INHERIT], // inherit, all
Line 32: ['id' => 3, 'parent_id' => 1, 'admin_perm_type' => Constants::PERM_SPECIFIC], // no perms
Line 33: ['id' => 4, 'parent_id' => 1, 'admin_perm_type' => Constants::PERM_SPECIFIC], // group 1
Line 34: ['id' => 5, 'parent_id' => 1, 'admin_perm_type' => Constants::PERM_SPECIFIC], // group 2
Line 36: ['id' => 6, 'parent_id' => 0, 'admin_perm_type' => Constants::PERM_SPECIFIC], // top-level, none
Line 37: ['id' => 7, 'parent_id' => 6, 'admin_perm_type' => Constants::PERM_INHERIT], // inherit, none
Line 38: ['id' => 8, 'parent_id' => 6, 'admin_perm_type' => Constants::PERM_SPECIFIC], // specific, group 1
Line 40: ['id' => 9, 'parent_id' => 0, 'admin_perm_type' => Constants::PERM_SPECIFIC], // top-level, group 1
Line 41: ['id' => 10,'parent_id' => 9, 'admin_perm_type' => Constants::PERM_INHERIT], // inherit, group 1
Line 42: ['id' => 11,'parent_id' => 9, 'admin_perm_type' => Constants::PERM_SPECIFIC], // specific, group 2
Line 59: Pdb::query('CREATE TABLE ~pages (id INT, parent_id INT, admin_perm_type INT)', [], 'null');
Line 69: Pdb::query('CREATE TABLE ~page_admin_permissions (item_id INT, category_id INT)', [], 'null');
Line 71: Pdb::insert('page_admin_permissions', $row);
Line 106: $this->assertEquals($expected, AdminPerms::getAccessableGroups('pages', $page_id));

/sprout/tests/admin_authTest.php   Highlighted file source

Line 14: use Sprout\Helpers\AdminAuth;
Line 18: class admin_authTest extends PHPUnit_Framework_TestCase
Line 37: if (! AdminAuth::checkAlgorithm($alg)) return;
Line 39: list ($a, $b, $c) = AdminAuth::hashPassword('Match', $alg);
Line 40: $result = AdminAuth::doPasswordCheck($a, $b, $c, 'Match');
Line 44: list ($a, $b, $c) = AdminAuth::hashPassword('Match', $alg);
Line 45: $result = AdminAuth::doPasswordCheck($a, $b, $c, 'Do not match');
Line 57: if (! AdminAuth::checkAlgorithm($alg)) return;
Line 58: list ($a1, $b1, $c1) = AdminAuth::hashPassword('Match', $alg);
Line 59: list ($a2, $b2, $c2) = AdminAuth::hashPassword('Match', $alg);
Line 69: $this->assertTrue(AdminAuth::checkAlgorithm(Constants::PASSWORD_SHA_SALT));
Line 70: $this->assertTrue(AdminAuth::checkAlgorithm(Constants::PASSWORD_SHA_SALT_5000));
Line 71: $this->assertFalse(AdminAuth::checkAlgorithm(1234));

/sprout/tests/admin_authTest.php   Highlighted file source

Line 14: use Sprout\Helpers\AdminAuth;
Line 18: class admin_authTest extends PHPUnit_Framework_TestCase
Line 37: if (! AdminAuth::checkAlgorithm($alg)) return;
Line 39: list ($a, $b, $c) = AdminAuth::hashPassword('Match', $alg);
Line 40: $result = AdminAuth::doPasswordCheck($a, $b, $c, 'Match');
Line 44: list ($a, $b, $c) = AdminAuth::hashPassword('Match', $alg);
Line 45: $result = AdminAuth::doPasswordCheck($a, $b, $c, 'Do not match');
Line 57: if (! AdminAuth::checkAlgorithm($alg)) return;
Line 58: list ($a1, $b1, $c1) = AdminAuth::hashPassword('Match', $alg);
Line 59: list ($a2, $b2, $c2) = AdminAuth::hashPassword('Match', $alg);
Line 69: $this->assertTrue(AdminAuth::checkAlgorithm(Constants::PASSWORD_SHA_SALT));
Line 70: $this->assertTrue(AdminAuth::checkAlgorithm(Constants::PASSWORD_SHA_SALT_5000));
Line 71: $this->assertFalse(AdminAuth::checkAlgorithm(1234));

/sprout/tests/navigationTest.php   Highlighted file source

Line 85: * Admin loading should bring in all pages, including inactive and unpublished
Line 87: public function testLoadPageTree__Admin()

/sprout/tests/navigationTest.php   Highlighted file source

Line 85: * Admin loading should bring in all pages, including inactive and unpublished
Line 87: public function testLoadPageTree__Admin()

/sprout/views/admin/categories_add.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 29: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/categories_add.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 29: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/categories_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 31: <?php Form::nextFieldDetails('Admin Visibility', false); ?>
Line 32: <?= Form::dropdown('show_admin', [], [1 => 'Current', 0 => 'Archived']); ?>
Line 36: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/categories_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 31: <?php Form::nextFieldDetails('Admin Visibility', false); ?>
Line 32: <?= Form::dropdown('show_admin', [], [1 => 'Current', 0 => 'Archived']); ?>
Line 36: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/categories_import_options.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 20: <?php Admin::categorySelection('categories[]', $cats, array()); ?>

/sprout/views/admin/categories_import_options.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 20: <?php Admin::categorySelection('categories[]', $cats, array()); ?>

/sprout/views/admin/categories_multi_categorise.php   Highlighted file source

Line 18: use Sprout\Helpers\Admin;
Line 30: <form action="SITE/admin/call/<?php echo $controller_name; ?>/postMultiCategorise" method="post" id="main-form">
Line 43: Admin::categorySelection('categories[]', $cats, []);

/sprout/views/admin/categories_multi_categorise.php   Highlighted file source

Line 18: use Sprout\Helpers\Admin;
Line 30: <form action="SITE/admin/call/<?php echo $controller_name; ?>/postMultiCategorise" method="post" id="main-form">
Line 43: Admin::categorySelection('categories[]', $cats, []);

/sprout/views/admin/email_text_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 46: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/email_text_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 46: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/extra_page_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 18: use Sprout\Helpers\AdminAuth;
Line 29: <?php if (AdminAuth::isSuper()): ?>
Line 42: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/extra_page_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 18: use Sprout\Helpers\AdminAuth;
Line 29: <?php if (AdminAuth::isSuper()): ?>
Line 42: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/file_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 58: <?= Form::autocomplete('author', [], ['url' => 'admin/call/file/ajaxAuthorLookup', 'save_id' => false]); ?>
Line 177: <img src="SITE/admin/call/file/previewTransform/none/<?php echo Enc::html($data['filename']); ?>" alt="" id="manipulate-preview">
Line 226: <?= Admin::categorySelection('categories[]', $cats, $data['categories']); ?>
Line 231: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/file_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 58: <?= Form::autocomplete('author', [], ['url' => 'admin/call/file/ajaxAuthorLookup', 'save_id' => false]); ?>
Line 177: <img src="SITE/admin/call/file/previewTransform/none/<?php echo Enc::html($data['filename']); ?>" alt="" id="manipulate-preview">
Line 226: <?= Admin::categorySelection('categories[]', $cats, $data['categories']); ?>
Line 231: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/generic_import.php   Highlighted file source

Line 16: use Sprout\Helpers\Admin;
Line 27: <form action="SITE/admin/import_action/<?php echo $controller_name; ?>" method="post">
Line 80: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/generic_import.php   Highlighted file source

Line 16: use Sprout\Helpers\Admin;
Line 27: <form action="SITE/admin/import_action/<?php echo $controller_name; ?>" method="post">
Line 80: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/main_layout.php   Highlighted file source

Line 16: use Sprout\Helpers\Admin;
Line 17: use Sprout\Helpers\AdminAuth;
Line 18: use Sprout\Helpers\AdminPerms;
Line 28: $merged_js = 'media/merged/admin.' . Sprout::getVersion() . '.js';
Line 29: $merged_css = 'media/merged/admin.' . Sprout::getVersion() . '.css';
Line 80: <link href="ROOT/sprout/media/css/admin_layout.css" rel="stylesheet">
Line 81: <link href="ROOT/sprout/media/css/admin_editing_area.css" rel="stylesheet">
Line 86: <?= Jquery::script('jquery', 'admin'); ?>
Line 87: <?= Jquery::script('jqueryui', 'admin'); ?>
Line 96: <script src="ROOT/sprout/media/js/admin_layout.js"></script>
Line 97: <script src="ROOT/sprout/media/js/admin_editing_area.js"></script>
Line 111: <?php if (AdminAuth::isSuper()): ?>
Line 125: <p>Admin access</p>
Line 128: <?php if (AdminPerms::getManageOperatorCategories()): ?>
Line 130: <a href="admin/intro/operator">Operators</a>
Line 133: <?php if (AdminPerms::canAccess('access_operators')): ?>
Line 135: <a href="admin/intro/per_record_permission">Per-record permissions</a>
Line 138: <?php if (AdminPerms::controllerAccess('action_log', 'contents')): ?>
Line 140: <a href="admin/intro/action_log">Activity log</a>
Line 148: <?php if (AdminPerms::controllerAccess('content_subscribe', 'contents')): ?>
Line 150: <a href="admin/intro/content_subscription">Content subscriptions</a>
Line 153: <?php if (AdminPerms::controllerAccess('extra_page', 'contents')): ?>
Line 155: <a href="admin/intro/extra_page">Snippet pages</a>
Line 158: <?php if (AdminPerms::controllerAccess('document_type', 'contents')): ?>
Line 160: <a href="admin/intro/document_type">Document types</a>
Line 163: <?php if (AdminPerms::controllerAccess('redirect', 'contents')): ?>
Line 165: <a href="admin/intro/redirect">Redirects</a>
Line 168: <?php if (AdminPerms::controllerAccess('subsite', 'contents')): ?>
Line 170: <a href="admin/intro/subsite">Subsites</a>
Line 176: <?php $operator = AdminAuth::getDetails(); ?>
Line 189: <?php if (AdminAuth::hasDatabaseRecord()): ?>
Line 191: <a href="admin/intro/my_settings">Settings</a>
Line 195: <a href="SITE/admin/logout">Log out</a>
Line 210: <?php echo Admin::topNav($controller_name); ?>
Line 220: <h1 class="site-title"><?php echo Enc::html(Subsites::getConfigAdmin('site_title')); ?></h1>
Line 227: <?php // echo Enc::html(Subsites::getName($_SESSION['admin']['active_subsite'])); ?>
Line 228: <?php echo Subsites::listSelector($_SESSION['admin']['active_subsite']); ?>

/sprout/views/admin/main_layout.php   Highlighted file source

Line 16: use Sprout\Helpers\Admin;
Line 17: use Sprout\Helpers\AdminAuth;
Line 18: use Sprout\Helpers\AdminPerms;
Line 28: $merged_js = 'media/merged/admin.' . Sprout::getVersion() . '.js';
Line 29: $merged_css = 'media/merged/admin.' . Sprout::getVersion() . '.css';
Line 80: <link href="ROOT/sprout/media/css/admin_layout.css" rel="stylesheet">
Line 81: <link href="ROOT/sprout/media/css/admin_editing_area.css" rel="stylesheet">
Line 86: <?= Jquery::script('jquery', 'admin'); ?>
Line 87: <?= Jquery::script('jqueryui', 'admin'); ?>
Line 96: <script src="ROOT/sprout/media/js/admin_layout.js"></script>
Line 97: <script src="ROOT/sprout/media/js/admin_editing_area.js"></script>
Line 111: <?php if (AdminAuth::isSuper()): ?>
Line 125: <p>Admin access</p>
Line 128: <?php if (AdminPerms::getManageOperatorCategories()): ?>
Line 130: <a href="admin/intro/operator">Operators</a>
Line 133: <?php if (AdminPerms::canAccess('access_operators')): ?>
Line 135: <a href="admin/intro/per_record_permission">Per-record permissions</a>
Line 138: <?php if (AdminPerms::controllerAccess('action_log', 'contents')): ?>
Line 140: <a href="admin/intro/action_log">Activity log</a>
Line 148: <?php if (AdminPerms::controllerAccess('content_subscribe', 'contents')): ?>
Line 150: <a href="admin/intro/content_subscription">Content subscriptions</a>
Line 153: <?php if (AdminPerms::controllerAccess('extra_page', 'contents')): ?>
Line 155: <a href="admin/intro/extra_page">Snippet pages</a>
Line 158: <?php if (AdminPerms::controllerAccess('document_type', 'contents')): ?>
Line 160: <a href="admin/intro/document_type">Document types</a>
Line 163: <?php if (AdminPerms::controllerAccess('redirect', 'contents')): ?>
Line 165: <a href="admin/intro/redirect">Redirects</a>
Line 168: <?php if (AdminPerms::controllerAccess('subsite', 'contents')): ?>
Line 170: <a href="admin/intro/subsite">Subsites</a>
Line 176: <?php $operator = AdminAuth::getDetails(); ?>
Line 189: <?php if (AdminAuth::hasDatabaseRecord()): ?>
Line 191: <a href="admin/intro/my_settings">Settings</a>
Line 195: <a href="SITE/admin/logout">Log out</a>
Line 210: <?php echo Admin::topNav($controller_name); ?>
Line 220: <h1 class="site-title"><?php echo Enc::html(Subsites::getConfigAdmin('site_title')); ?></h1>
Line 227: <?php // echo Enc::html(Subsites::getName($_SESSION['admin']['active_subsite'])); ?>
Line 228: <?php echo Subsites::listSelector($_SESSION['admin']['active_subsite']); ?>

/sprout/views/admin/operator_add.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 63: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/operator_add.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 63: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/operator_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 77: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/operator_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 77: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/operator_navigation.php   Highlighted file source

Line 17: use Sprout\Helpers\AdminPerms;
Line 25: $actions['admin/add/' . $controller_name . '?category_id=%%'] = 'Add ' . Inflector::singular($friendly_name);
Line 27: if (AdminPerms::canAccess('access_operators')) {
Line 28: $actions['admin/edit/' . $controller_name . '_category/%%'] = 'Edit category options';
Line 29: $actions['admin/delete/' . $controller_name . '_category/%%'] = 'Delete category';
Line 63: <?php if (AdminPerms::canAccess('access_operators')): ?>
Line 64: <a class="icon-after icon-add button button-small" href="admin/add/<?php echo $controller_name; ?>">Add <?php echo Inflector::singular($friendly_name); ?></a>
Line 66: <a class="icon-after icon-add button button-small" href="admin/add/<?php echo $controller_name . '_category'; ?>">Add category</a>
Line 73: <a class="node-link" href="admin/contents/<?php echo $controller_name; ?>">All <?php echo strtolower($friendly_name); ?></a>
Line 85: <a class="node-link" href="admin/contents/<?php echo $controller_name; ?>?_category_id=<?php echo $id; ?>"><?php echo $name; ?></a>

/sprout/views/admin/operator_navigation.php   Highlighted file source

Line 17: use Sprout\Helpers\AdminPerms;
Line 25: $actions['admin/add/' . $controller_name . '?category_id=%%'] = 'Add ' . Inflector::singular($friendly_name);
Line 27: if (AdminPerms::canAccess('access_operators')) {
Line 28: $actions['admin/edit/' . $controller_name . '_category/%%'] = 'Edit category options';
Line 29: $actions['admin/delete/' . $controller_name . '_category/%%'] = 'Delete category';
Line 63: <?php if (AdminPerms::canAccess('access_operators')): ?>
Line 64: <a class="icon-after icon-add button button-small" href="admin/add/<?php echo $controller_name; ?>">Add <?php echo Inflector::singular($friendly_name); ?></a>
Line 66: <a class="icon-after icon-add button button-small" href="admin/add/<?php echo $controller_name . '_category'; ?>">Add category</a>
Line 73: <a class="node-link" href="admin/contents/<?php echo $controller_name; ?>">All <?php echo strtolower($friendly_name); ?></a>
Line 85: <a class="node-link" href="admin/contents/<?php echo $controller_name; ?>?_category_id=<?php echo $id; ?>"><?php echo $name; ?></a>

/sprout/views/admin/page_add.php   Highlighted file source

Line 16: use Sprout\Helpers\Admin;
Line 54: <?php if (Subsites::getConfigAdmin('nav_groups') !== null): ?>
Line 57: echo Form::dropdown('menu_group', ['-dropdown-top' => 'None -- Top level page', '-wrapper-class' => 'white'], NavigationGroups::getAllNamesAdmin());
Line 87: echo Form::multiradio('admin_perm_specific', [], [
Line 92: <div class="admin_perms">
Line 94: echo Form::checkboxSet('admin_permissions[]', [], $admin_category_options);
Line 105: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/page_add.php   Highlighted file source

Line 16: use Sprout\Helpers\Admin;
Line 54: <?php if (Subsites::getConfigAdmin('nav_groups') !== null): ?>
Line 57: echo Form::dropdown('menu_group', ['-dropdown-top' => 'None -- Top level page', '-wrapper-class' => 'white'], NavigationGroups::getAllNamesAdmin());
Line 87: echo Form::multiradio('admin_perm_specific', [], [
Line 92: <div class="admin_perms">
Line 94: echo Form::checkboxSet('admin_permissions[]', [], $admin_category_options);
Line 105: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/page_edit.php   Highlighted file source

Line 16: use Sprout\Helpers\Admin;
Line 51: $subsite_absroot = Subsites::getAbsRoot($_SESSION['admin']['active_subsite'], Request::protocol());
Line 53: $base = Subsites::getAbsRoot($_SESSION['admin']['active_subsite']);
Line 87: <?php if (Subsites::getConfigAdmin('nav_groups') !== null): ?>
Line 90: echo Form::dropdown('menu_group', ['-dropdown-top' => 'None -- Don\'t show in menu'], NavigationGroups::getAllNamesAdmin());
Line 165: <?php Admin::attrEditor($data['multiedit_attrs']); ?>
Line 190: echo Form::multiradio('admin_perm_specific', [], [
Line 195: <div class="admin_perms">
Line 197: echo Form::checkboxSet('admin_permissions', [], $admin_category_options);
Line 226: $rev_edit_url = "admin/edit/page/{$id}?revision={$rev['id']}";
Line 293: if ($admin_notes) {
Line 294: echo '<ul class="messages all-type-neutral"><li class="neutral">', Text::richtext($admin_notes), '</li></ul>';
Line 348: Admin::widgetList($area->getName(), $area, @$widgets[$area_id], empty($page['redirect']));
Line 382: Admin::widgetList($area->getName(), $area, @$widgets[$area_id], empty($page['redirect']));
Line 388: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/page_edit.php   Highlighted file source

Line 16: use Sprout\Helpers\Admin;
Line 51: $subsite_absroot = Subsites::getAbsRoot($_SESSION['admin']['active_subsite'], Request::protocol());
Line 53: $base = Subsites::getAbsRoot($_SESSION['admin']['active_subsite']);
Line 87: <?php if (Subsites::getConfigAdmin('nav_groups') !== null): ?>
Line 90: echo Form::dropdown('menu_group', ['-dropdown-top' => 'None -- Don\'t show in menu'], NavigationGroups::getAllNamesAdmin());
Line 165: <?php Admin::attrEditor($data['multiedit_attrs']); ?>
Line 190: echo Form::multiradio('admin_perm_specific', [], [
Line 195: <div class="admin_perms">
Line 197: echo Form::checkboxSet('admin_permissions', [], $admin_category_options);
Line 226: $rev_edit_url = "admin/edit/page/{$id}?revision={$rev['id']}";
Line 293: if ($admin_notes) {
Line 294: echo '<ul class="messages all-type-neutral"><li class="neutral">', Text::richtext($admin_notes), '</li></ul>';
Line 348: Admin::widgetList($area->getName(), $area, @$widgets[$area_id], empty($page['redirect']));
Line 382: Admin::widgetList($area->getName(), $area, @$widgets[$area_id], empty($page['redirect']));
Line 388: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/page_intro.php   Highlighted file source

Line 17: use Sprout\Helpers\AdminPerms;
Line 24: <form action="SITE/admin/contents/<?php echo strtolower($controller_name); ?>" method="get">
Line 35: <form action="SITE/admin/add/<?php echo strtolower($controller_name); ?>" method="get">
Line 42: <?php if (AdminPerms::canAccess('access_noapproval') and $need_approval): ?>

/sprout/views/admin/page_intro.php   Highlighted file source

Line 17: use Sprout\Helpers\AdminPerms;
Line 24: <form action="SITE/admin/contents/<?php echo strtolower($controller_name); ?>" method="get">
Line 35: <form action="SITE/admin/add/<?php echo strtolower($controller_name); ?>" method="get">
Line 42: <?php if (AdminPerms::canAccess('access_noapproval') and $need_approval): ?>

/sprout/views/admin/page_navigation.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 21: use Sprout\Helpers\AdminAuth;
Line 24: Needs::fileGroup('sprout/admin_page_navigation');
Line 28: <a class="icon-after icon-add tree-list-add button button-small" href="SITE/admin/add/<?php echo $controller_name; ?>">Add <?php echo Inflector::singular($friendly_name); ?></a>
Line 29: <?php if (AdminAuth::isSuper()): ?>
Line 30: <a class="icon-after icon-add tree-list-add button button-small" href="SITE/admin/add/<?php echo $controller_name; ?>?type=tool">Add tool <?php echo Inflector::singular($friendly_name); ?></a>
Line 36: $class = (Admin::getControllerSlug() === 'home_page' ? 'active-node' : '');
Line 41: <a class="node-link" href="SITE/admin/edit/home_page/<?= (int) $home_page_id; ?>">Home</a>
Line 46: <a href="SITE/admin/edit/home_page/<?= (int) $home_page_id; ?>">Edit home page</a>
Line 54: $nav_limit = Subsites::getConfigAdmin('nav_limit');
Line 56: if (Subsites::getConfigAdmin('nav_home')) $nav_limit--;
Line 61: 'url' => 'admin/edit/page/%%',
Line 65: 'url' => 'admin/add/page?parent_id=%%',
Line 69: 'url' => 'admin/call/page/reorder/%%',
Line 74: 'url' => 'admin/delete/page/%%',
Line 81: 'url' => 'admin/edit/page/%%',
Line 85: 'url' => 'admin/add/page?parent_id=%%',
Line 89: 'url' => 'admin/delete/page/%%',
Line 100: Admin::navigationTreeNode($node, $dropdown_actions);
Line 102: Admin::navigationTreeNode($node, $dropdown_actions_no_children);

/sprout/views/admin/page_navigation.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 21: use Sprout\Helpers\AdminAuth;
Line 24: Needs::fileGroup('sprout/admin_page_navigation');
Line 28: <a class="icon-after icon-add tree-list-add button button-small" href="SITE/admin/add/<?php echo $controller_name; ?>">Add <?php echo Inflector::singular($friendly_name); ?></a>
Line 29: <?php if (AdminAuth::isSuper()): ?>
Line 30: <a class="icon-after icon-add tree-list-add button button-small" href="SITE/admin/add/<?php echo $controller_name; ?>?type=tool">Add tool <?php echo Inflector::singular($friendly_name); ?></a>
Line 36: $class = (Admin::getControllerSlug() === 'home_page' ? 'active-node' : '');
Line 41: <a class="node-link" href="SITE/admin/edit/home_page/<?= (int) $home_page_id; ?>">Home</a>
Line 46: <a href="SITE/admin/edit/home_page/<?= (int) $home_page_id; ?>">Edit home page</a>
Line 54: $nav_limit = Subsites::getConfigAdmin('nav_limit');
Line 56: if (Subsites::getConfigAdmin('nav_home')) $nav_limit--;
Line 61: 'url' => 'admin/edit/page/%%',
Line 65: 'url' => 'admin/add/page?parent_id=%%',
Line 69: 'url' => 'admin/call/page/reorder/%%',
Line 74: 'url' => 'admin/delete/page/%%',
Line 81: 'url' => 'admin/edit/page/%%',
Line 85: 'url' => 'admin/add/page?parent_id=%%',
Line 89: 'url' => 'admin/delete/page/%%',
Line 100: Admin::navigationTreeNode($node, $dropdown_actions);
Line 102: Admin::navigationTreeNode($node, $dropdown_actions_no_children);

/sprout/views/admin/subsite_add.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 38: <?php Admin::checkboxList(null, array(
Line 40: 'require_admin' => 'Only allow access if logged-in to admin area',
Line 67: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/subsite_add.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 38: <?php Admin::checkboxList(null, array(
Line 40: 'require_admin' => 'Only allow access if logged-in to admin area',
Line 67: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/subsite_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 39: <?php Admin::checkboxList(null, array(
Line 41: 'require_admin' => 'Only allow access if logged-in to admin area',
Line 67: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/subsite_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 39: <?php Admin::checkboxList(null, array(
Line 41: 'require_admin' => 'Only allow access if logged-in to admin area',
Line 67: <?php Admin::clearFieldErrors(); ?>

/sprout/views/admin/tree_organise.php   Highlighted file source

Line 13: use Sprout\Helpers\AdminAuth;
Line 22: echo '<script>admin_auth = {is_remote: ', (AdminAuth::isSuper() ? 'true' : 'false'), '};</script>';
Line 25: <form id="main-form" action="SITE/admin/call/<?= Enc::html($controller_name); ?>/organiseAction" method="post" class="-clearfix">

/sprout/views/admin/tree_organise.php   Highlighted file source

Line 13: use Sprout\Helpers\AdminAuth;
Line 22: echo '<script>admin_auth = {is_remote: ', (AdminAuth::isSuper() ? 'true' : 'false'), '};</script>';
Line 25: <form id="main-form" action="SITE/admin/call/<?= Enc::html($controller_name); ?>/organiseAction" method="post" class="-clearfix">

/sprout/views/auto_edit.php   Highlighted file source

Line 2: use Sprout\Helpers\Admin;
Line 37: echo Admin::categorySelection('categories[]', $cats, $data['categories']);

/sprout/views/auto_edit.php   Highlighted file source

Line 2: use Sprout\Helpers\Admin;
Line 37: echo Admin::categorySelection('categories[]', $cats, $data['categories']);

/sprout/views/content_unsubscribe_form.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 25: <?php Admin::checkboxList('unsubscribe[]', $subscriptions, array()); ?>

/sprout/views/content_unsubscribe_form.php   Highlighted file source

Line 17: use Sprout\Helpers\Admin;
Line 25: <?php Admin::checkboxList('unsubscribe[]', $subscriptions, array()); ?>

A total of 2816 lines in 179 files were found