SproutCMS

This is the code documentation for the SproutCMS project

class Category

Source code (76 results)

/modules/Demo/admin_load.php   Highlighted file source

Line 19: 'demo_item_category' => 'Admin\DemoItemCategoryAdminController',
Line 21: 'word_category' => 'Admin\WordCategoryAdminController',

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

Line 16: use Sprout\Controllers\Admin\CategoryAdminController;
Line 22: class DemoItemCategoryAdminController extends CategoryAdminController
Line 24: protected $controller_name = 'demo_item_category';

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

Line 16: use Sprout\Controllers\Admin\CategoryAdminController;
Line 22: class WordCategoryAdminController extends CategoryAdminController
Line 24: protected $controller_name = 'word_category';

/modules/HarborAndSprout/admin_load.php   Highlighted file source

Line 19: 'fruit_category' => 'Admin\FruitCategoryAdminController',

/sprout/config/routes.php   Highlighted file source

Line 38: $config['admin_ajax/add_category'] = 'AdminAjaxController/addCategory';

/sprout/config/routes.php   Highlighted file source

Line 38: $config['admin_ajax/add_category'] = 'AdminAjaxController/addCategory';

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

Line 22: use Sprout\Helpers\Category;
Line 34: * This is a generic controller which category controllers should extend.
Line 36: abstract class CategoryAdminController extends ManagedAdminController {
Line 44: * The view to use for adding new category records. Loaded in a popup
Line 49: * The view to use for editing existing category records
Line 62: $base_name = str_replace('_category', '', $this->controller_name);
Line 63: $this->table_name = Category::tableMain2cat(Inflector::plural($base_name));
Line 65: $parent_class = preg_replace('/CategoryAdminController$/', 'AdminController', get_class($this));
Line 200: . ' to have this category edited</i></p>';
Line 227: $view->category_archive = $this->parent_inst->getCategoryArchive();
Line 247: Notification::error('Unable to edit category');
Line 271: if ($this->parent_inst->getCategoryArchive()) {
Line 285: * Shows delete form for deleting this category
Line 287: * @param int $id The category id
Line 293: . ' to have this category deleted.</i></p>';
Line 296: $main_controller = str_replace('_category', '', $this->controller_name);
Line 298: $cat_table = Category::tableMain2cat($main_table);
Line 299: $joiner_table = Category::tableMain2joiner($main_table);
Line 302: $category = Pdb::q($q, [$id], 'row');
Line 316: $view->category = $category;
Line 320: 'title' => 'Delete category <strong>' . Enc::html($category['name']) . '</strong>',
Line 326: * Deletes a category
Line 336: Notification::error('Unable to delete category');
Line 340: $main_controller = str_replace('_category', '', $this->controller_name);
Line 342: $cat_table = Category::tableMain2cat($main_table);
Line 343: $joiner_table = Category::tableMain2joiner($main_table);
Line 363: // Delete category
Line 366: // Delete references to category
Line 377: * Shows the reorder page for re-ordering the items for this category
Line 379: public function _extraReorder($category_id)
Line 381: $category_id = (int) $category_id;
Line 387: $item_name = str_replace('_category', '', $this->controller_name);
Line 389: $joiner_table = Category::tableMain2joiner($item_table);
Line 391: // Load the category
Line 394: $page = Pdb::q($q, [$category_id], 'row');
Line 396: return new AdminError('Invalid id specified - category does not exist');
Line 399: // Items in the category
Line 406: $items = Pdb::q($q, [$category_id], 'arr');
Line 409: return new AdminError('This category does not have enough items in it for re-ordering.');
Line 418: $view->id = $category_id;
Line 431: public function reorderSave($category_id)
Line 433: $category_id = (int) $category_id;
Line 444: $item_name = str_replace('_category', '', $this->controller_name);
Line 445: $joiner_table = Category::tableMain2joiner(Inflector::plural($item_name));
Line 451: $where = ['cat_id' => $category_id, "{$item_name}_id" => $id];
Line 458: Url::redirect("admin/contents/{$item_name}?_category_id={$category_id}");
Line 473: // Load the category
Line 513: $item_name = str_replace('_category', '', $this->controller_name);
Line 514: Notification::confirm('Category re-order was successful');
Line 520: * Archive a category
Line 522: public function ajaxArchiveAction($category_id)
Line 528: Pdb::update($this->table_name, $data, ['id' => $category_id]);
Line 535: * Unarchive a category
Line 537: public function ajaxUnarchiveAction($category_id)
Line 543: Pdb::update($this->table_name, $data, ['id' => $category_id]);

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

Line 22: use Sprout\Helpers\Category;
Line 34: * This is a generic controller which category controllers should extend.
Line 36: abstract class CategoryAdminController extends ManagedAdminController {
Line 44: * The view to use for adding new category records. Loaded in a popup
Line 49: * The view to use for editing existing category records
Line 62: $base_name = str_replace('_category', '', $this->controller_name);
Line 63: $this->table_name = Category::tableMain2cat(Inflector::plural($base_name));
Line 65: $parent_class = preg_replace('/CategoryAdminController$/', 'AdminController', get_class($this));
Line 200: . ' to have this category edited</i></p>';
Line 227: $view->category_archive = $this->parent_inst->getCategoryArchive();
Line 247: Notification::error('Unable to edit category');
Line 271: if ($this->parent_inst->getCategoryArchive()) {
Line 285: * Shows delete form for deleting this category
Line 287: * @param int $id The category id
Line 293: . ' to have this category deleted.</i></p>';
Line 296: $main_controller = str_replace('_category', '', $this->controller_name);
Line 298: $cat_table = Category::tableMain2cat($main_table);
Line 299: $joiner_table = Category::tableMain2joiner($main_table);
Line 302: $category = Pdb::q($q, [$id], 'row');
Line 316: $view->category = $category;
Line 320: 'title' => 'Delete category <strong>' . Enc::html($category['name']) . '</strong>',
Line 326: * Deletes a category
Line 336: Notification::error('Unable to delete category');
Line 340: $main_controller = str_replace('_category', '', $this->controller_name);
Line 342: $cat_table = Category::tableMain2cat($main_table);
Line 343: $joiner_table = Category::tableMain2joiner($main_table);
Line 363: // Delete category
Line 366: // Delete references to category
Line 377: * Shows the reorder page for re-ordering the items for this category
Line 379: public function _extraReorder($category_id)
Line 381: $category_id = (int) $category_id;
Line 387: $item_name = str_replace('_category', '', $this->controller_name);
Line 389: $joiner_table = Category::tableMain2joiner($item_table);
Line 391: // Load the category
Line 394: $page = Pdb::q($q, [$category_id], 'row');
Line 396: return new AdminError('Invalid id specified - category does not exist');
Line 399: // Items in the category
Line 406: $items = Pdb::q($q, [$category_id], 'arr');
Line 409: return new AdminError('This category does not have enough items in it for re-ordering.');
Line 418: $view->id = $category_id;
Line 431: public function reorderSave($category_id)
Line 433: $category_id = (int) $category_id;
Line 444: $item_name = str_replace('_category', '', $this->controller_name);
Line 445: $joiner_table = Category::tableMain2joiner(Inflector::plural($item_name));
Line 451: $where = ['cat_id' => $category_id, "{$item_name}_id" => $id];
Line 458: Url::redirect("admin/contents/{$item_name}?_category_id={$category_id}");
Line 473: // Load the category
Line 513: $item_name = str_replace('_category', '', $this->controller_name);
Line 514: Notification::confirm('Category re-order was successful');
Line 520: * Archive a category
Line 522: public function ajaxArchiveAction($category_id)
Line 528: Pdb::update($this->table_name, $data, ['id' => $category_id]);
Line 535: * Unarchive a category
Line 537: public function ajaxUnarchiveAction($category_id)
Line 543: Pdb::update($this->table_name, $data, ['id' => $category_id]);

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

Line 26: use Sprout\Helpers\Category;
Line 68: protected $category_archive = true;
Line 356: // Only one category? Select that. Category specified? Select that.
Line 358: $view->data['category_id'] = key($view->categories);
Line 359: } else if (!empty($_GET['form']['category_id'])) {
Line 360: $view->data['category_id'] = $_GET['form']['category_id'];
Line 450: if (!empty($_POST['category_id'])) {
Line 451: Category::insertInto('files', $file_id, $_POST['category_id']);
Line 577: $result = $this->doUpload(@$_POST['category_id']);
Line 585: * @param int $category_id ID of category to store file in
Line 587: private function doUpload($category_id)
Line 589: $category_id = (int) $category_id;
Line 650: // Add category
Line 651: if (!empty($_POST['category_new'])) {
Line 653: return array('error' => 'Unable to create category; no permissions');
Line 656: $category_id = Category::create('files', $_POST['category_new']);
Line 662: // Add file category
Line 663: if ($category_id) {
Line 665: Category::insertInto('files', $file_id, $category_id);
Line 692: 'cat_id' => $category_id,
Line 1231: $joiner_table = Category::tableMain2joiner('files');
Line 1265: * @param StdClass $category Category details if a category has been selected.
Line 1267: public function _getContentsView($items, $mode, $category)
Line 1270: return $this->_getContentsViewList($items, $category);
Line 1272: return $this->_getContentsViewThumb($items, $category);
Line 1280: private function _getContentsViewThumb($items, $category)
Line 1287: $view->category = $category;
Line 1365: $view->req_category = isset($_GET['req_category']) ? (int) $_GET['req_category'] : 1;
Line 1391: $_GET['category_id'] = (int) $_GET['category_id'];
Line 1397: if ($_GET['category_id'] > 0) {
Line 1400: $params[] = $_GET['category_id'];

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

Line 26: use Sprout\Helpers\Category;
Line 68: protected $category_archive = true;
Line 356: // Only one category? Select that. Category specified? Select that.
Line 358: $view->data['category_id'] = key($view->categories);
Line 359: } else if (!empty($_GET['form']['category_id'])) {
Line 360: $view->data['category_id'] = $_GET['form']['category_id'];
Line 450: if (!empty($_POST['category_id'])) {
Line 451: Category::insertInto('files', $file_id, $_POST['category_id']);
Line 577: $result = $this->doUpload(@$_POST['category_id']);
Line 585: * @param int $category_id ID of category to store file in
Line 587: private function doUpload($category_id)
Line 589: $category_id = (int) $category_id;
Line 650: // Add category
Line 651: if (!empty($_POST['category_new'])) {
Line 653: return array('error' => 'Unable to create category; no permissions');
Line 656: $category_id = Category::create('files', $_POST['category_new']);
Line 662: // Add file category
Line 663: if ($category_id) {
Line 665: Category::insertInto('files', $file_id, $category_id);
Line 692: 'cat_id' => $category_id,
Line 1231: $joiner_table = Category::tableMain2joiner('files');
Line 1265: * @param StdClass $category Category details if a category has been selected.
Line 1267: public function _getContentsView($items, $mode, $category)
Line 1270: return $this->_getContentsViewList($items, $category);
Line 1272: return $this->_getContentsViewThumb($items, $category);
Line 1280: private function _getContentsViewThumb($items, $category)
Line 1287: $view->category = $category;
Line 1365: $view->req_category = isset($_GET['req_category']) ? (int) $_GET['req_category'] : 1;
Line 1391: $_GET['category_id'] = (int) $_GET['category_id'];
Line 1397: if ($_GET['category_id'] > 0) {
Line 1400: $params[] = $_GET['category_id'];

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

Line 20: class FileCategoryAdminController extends CategoryAdminController
Line 22: protected $controller_name = 'file_category';

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

Line 20: class FileCategoryAdminController extends CategoryAdminController
Line 22: protected $controller_name = 'file_category';

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

Line 23: use Sprout\Helpers\Category;
Line 51: * You will need a "record_order" column on the category table.
Line 53: protected $category_reorder = false;
Line 57: * This uses radiobuttons instead of checkboxes in the category selection UI.
Line 59: protected $category_single = false;
Line 63: * You will need a "show_admin TINYINT UNSIGNED DEFAULT 1" column on the category table.
Line 65: protected $category_archive = false;
Line 83: $this->refine_bar->addWidget(new RefineWidgetSelect('_category_id', 'Category', $records));
Line 90: * Returns TRUE if category archive is enabled, FALSE otherwise
Line 92: public final function getCategoryArchive() {
Line 93: return $this->category_archive;
Line 109: public function catAllowEdit($category_id)
Line 118: public function catAllowDelete($category_id)
Line 129: $joiner_ref_col = Category::columnMain2joiner($this->table_name);
Line 137: if ($this->category_archive) {
Line 141: $_GET['category_type'] = (int) @$_GET['category_type'];
Line 142: if (! $_GET['category_type']) {
Line 143: $_GET['category_type'] = @$_SESSION['admin']['category_type'];
Line 147: if (! $_GET['category_type']) {
Line 148: $_GET['category_type'] = Constants::CATEGORIES_CURRENT;
Line 152: $clause = Constants::$category_admin_where[$_GET['category_type']];
Line 155: $_SESSION['admin']['category_type'] = $_GET['category_type'];
Line 159: // Get the category names, and the number of items in each
Line 167: ORDER BY " . ($this->category_reorder ? 'categories.record_order, categories.name' : 'categories.name');
Line 180: // If there were any, create an 'uncategorised' meta-category
Line 193: $view->category_reorder = $this->category_reorder;
Line 194: $view->category_archive = $this->category_archive;
Line 198: if ($this->category_archive) {
Line 199: $view->category_archive_type = $_GET['category_type'];
Line 217: if ($this->category_reorder) {
Line 218: $tools['reorder'] = "<li class=\"reorder\"><a href=\"admin/extra/{$this->controller_name}_category/reorder_categories\">Reorder Categories</a></li>";
Line 239: $joiner_ref_col = Category::columnMain2joiner($this->table_name);
Line 242: case '_category_id':
Line 269: // Apply category filter
Line 270: if (@$_GET['_category_id'] == '0') {
Line 272: $category = null;
Line 274: } else if (empty($_GET['_category_id'])) {
Line 276: $category = null;
Line 280: $_GET['_category_id'] = (int) $_GET['_category_id'];
Line 282: $category = Pdb::q($q, [$_GET['_category_id']], 'row');
Line 283: $title = $this->friendly_name . ' category <strong>' . Enc::html($category['name']) . '</strong>';
Line 303: } else if (isset($_GET['_category_id'])) {
Line 304: $joiner_table = Category::tableMain2joiner($this->table_name);
Line 305: $joiner_ref_col = Category::columnMain2joiner($this->table_name);
Line 307: $cat_id = (int) $_GET['_category_id'];
Line 366: $items_view = $this->_getContentsView($items, $_GET['main_mode'], $category);
Line 389: * @param StdClass $category Category details if a category has been selected.
Line 391: public function _getContentsView($items, $mode, $category)
Line 393: return $this->_getContentsViewList($items, $category);
Line 401: * @param StdClass $category Category details if a category has been selected.
Line 403: public function _getContentsViewList($items, $category)
Line 441: $outer->category_reorder = $this->category_reorder;
Line 445: $outer->category = $category;
Line 461: $cats_table = Category::tableMain2cat($this->table_name);
Line 462: $q = "SELECT category.id, category.name
Line 463: FROM ~{$cats_table} AS category
Line 464: ORDER BY category.name";
Line 467: Admin::setCategoryTablename($cats_table);
Line 468: Admin::setCategorySinglecat($this->category_single);
Line 489: Category::insertInto($this->table_name, $record_id, $cat_id);
Line 519: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 520: Admin::setCategorySinglecat($this->category_single);
Line 523: $q = "SELECT category.id, category.name
Line 524: FROM ~{$this->table_name}_cat_list AS category
Line 525: ORDER BY category.name";
Line 529: if (!empty($_GET['category_id'])) {
Line 530: $data['categories'][] = (int) $_GET['category_id'];
Line 570: $joiner_ref_col = Category::columnMain2joiner($this->table_name);
Line 583: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 584: Admin::setCategorySinglecat($this->category_single);
Line 587: $q = "SELECT category.id, category.name
Line 588: FROM ~{$this->table_name}_cat_list AS category
Line 589: ORDER BY category.name";
Line 658: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 659: Admin::setCategorySinglecat($this->category_single);
Line 662: $cat_table = Category::tableMain2cat($this->table_name);
Line 663: $q = "SELECT category.id, category.name
Line 664: FROM ~{$cat_table} AS category
Line 665: ORDER BY category.name";
Line 752: $cat_table = Category::tableMain2joiner($this->table_name);
Line 753: $record_col = Category::columnMain2joiner($this->table_name);
Line 764: * Updates the category table for this controller (so for articles, the updated table will be articles_cat_join)
Line 765: * so that the records for the specified item match the category ids provided.
Line 767: * @param array $categories A list of category-ids which the specified item should be associated with
Line 808: $this->logAddCategory(Inflector::plural($this->controller_name), $item_id, $cat_id);
Line 818: $this->logDeleteCategory(Inflector::plural($this->controller_name), $item_id, $cat_id);
Line 840: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 841: Admin::setCategorySinglecat($this->category_single);
Line 849: $cat_table = Category::tableMain2cat($this->table_name);
Line 850: $q = "SELECT category.id, category.name
Line 851: FROM ~{$cat_table} AS category
Line 852: ORDER BY category.name";
Line 909: Category::insertInto($this->table_name, $item_id, $cat_id);

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

Line 23: use Sprout\Helpers\Category;
Line 51: * You will need a "record_order" column on the category table.
Line 53: protected $category_reorder = false;
Line 57: * This uses radiobuttons instead of checkboxes in the category selection UI.
Line 59: protected $category_single = false;
Line 63: * You will need a "show_admin TINYINT UNSIGNED DEFAULT 1" column on the category table.
Line 65: protected $category_archive = false;
Line 83: $this->refine_bar->addWidget(new RefineWidgetSelect('_category_id', 'Category', $records));
Line 90: * Returns TRUE if category archive is enabled, FALSE otherwise
Line 92: public final function getCategoryArchive() {
Line 93: return $this->category_archive;
Line 109: public function catAllowEdit($category_id)
Line 118: public function catAllowDelete($category_id)
Line 129: $joiner_ref_col = Category::columnMain2joiner($this->table_name);
Line 137: if ($this->category_archive) {
Line 141: $_GET['category_type'] = (int) @$_GET['category_type'];
Line 142: if (! $_GET['category_type']) {
Line 143: $_GET['category_type'] = @$_SESSION['admin']['category_type'];
Line 147: if (! $_GET['category_type']) {
Line 148: $_GET['category_type'] = Constants::CATEGORIES_CURRENT;
Line 152: $clause = Constants::$category_admin_where[$_GET['category_type']];
Line 155: $_SESSION['admin']['category_type'] = $_GET['category_type'];
Line 159: // Get the category names, and the number of items in each
Line 167: ORDER BY " . ($this->category_reorder ? 'categories.record_order, categories.name' : 'categories.name');
Line 180: // If there were any, create an 'uncategorised' meta-category
Line 193: $view->category_reorder = $this->category_reorder;
Line 194: $view->category_archive = $this->category_archive;
Line 198: if ($this->category_archive) {
Line 199: $view->category_archive_type = $_GET['category_type'];
Line 217: if ($this->category_reorder) {
Line 218: $tools['reorder'] = "<li class=\"reorder\"><a href=\"admin/extra/{$this->controller_name}_category/reorder_categories\">Reorder Categories</a></li>";
Line 239: $joiner_ref_col = Category::columnMain2joiner($this->table_name);
Line 242: case '_category_id':
Line 269: // Apply category filter
Line 270: if (@$_GET['_category_id'] == '0') {
Line 272: $category = null;
Line 274: } else if (empty($_GET['_category_id'])) {
Line 276: $category = null;
Line 280: $_GET['_category_id'] = (int) $_GET['_category_id'];
Line 282: $category = Pdb::q($q, [$_GET['_category_id']], 'row');
Line 283: $title = $this->friendly_name . ' category <strong>' . Enc::html($category['name']) . '</strong>';
Line 303: } else if (isset($_GET['_category_id'])) {
Line 304: $joiner_table = Category::tableMain2joiner($this->table_name);
Line 305: $joiner_ref_col = Category::columnMain2joiner($this->table_name);
Line 307: $cat_id = (int) $_GET['_category_id'];
Line 366: $items_view = $this->_getContentsView($items, $_GET['main_mode'], $category);
Line 389: * @param StdClass $category Category details if a category has been selected.
Line 391: public function _getContentsView($items, $mode, $category)
Line 393: return $this->_getContentsViewList($items, $category);
Line 401: * @param StdClass $category Category details if a category has been selected.
Line 403: public function _getContentsViewList($items, $category)
Line 441: $outer->category_reorder = $this->category_reorder;
Line 445: $outer->category = $category;
Line 461: $cats_table = Category::tableMain2cat($this->table_name);
Line 462: $q = "SELECT category.id, category.name
Line 463: FROM ~{$cats_table} AS category
Line 464: ORDER BY category.name";
Line 467: Admin::setCategoryTablename($cats_table);
Line 468: Admin::setCategorySinglecat($this->category_single);
Line 489: Category::insertInto($this->table_name, $record_id, $cat_id);
Line 519: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 520: Admin::setCategorySinglecat($this->category_single);
Line 523: $q = "SELECT category.id, category.name
Line 524: FROM ~{$this->table_name}_cat_list AS category
Line 525: ORDER BY category.name";
Line 529: if (!empty($_GET['category_id'])) {
Line 530: $data['categories'][] = (int) $_GET['category_id'];
Line 570: $joiner_ref_col = Category::columnMain2joiner($this->table_name);
Line 583: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 584: Admin::setCategorySinglecat($this->category_single);
Line 587: $q = "SELECT category.id, category.name
Line 588: FROM ~{$this->table_name}_cat_list AS category
Line 589: ORDER BY category.name";
Line 658: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 659: Admin::setCategorySinglecat($this->category_single);
Line 662: $cat_table = Category::tableMain2cat($this->table_name);
Line 663: $q = "SELECT category.id, category.name
Line 664: FROM ~{$cat_table} AS category
Line 665: ORDER BY category.name";
Line 752: $cat_table = Category::tableMain2joiner($this->table_name);
Line 753: $record_col = Category::columnMain2joiner($this->table_name);
Line 764: * Updates the category table for this controller (so for articles, the updated table will be articles_cat_join)
Line 765: * so that the records for the specified item match the category ids provided.
Line 767: * @param array $categories A list of category-ids which the specified item should be associated with
Line 808: $this->logAddCategory(Inflector::plural($this->controller_name), $item_id, $cat_id);
Line 818: $this->logDeleteCategory(Inflector::plural($this->controller_name), $item_id, $cat_id);
Line 840: Admin::setCategoryTablename("{$this->table_name}_cat_list");
Line 841: Admin::setCategorySinglecat($this->category_single);
Line 849: $cat_table = Category::tableMain2cat($this->table_name);
Line 850: $q = "SELECT category.id, category.name
Line 851: FROM ~{$cat_table} AS category
Line 852: ORDER BY category.name";
Line 909: Category::insertInto($this->table_name, $item_id, $cat_id);

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

Line 381: // Build the refine bar, adding the 'category' field if required
Line 928: $cat_clause = PerRecordPerms::getCategoryClause();

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

Line 381: // Build the refine bar, adding the 'category' field if required
Line 928: $cat_clause = PerRecordPerms::getCategoryClause();

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

Line 29: class OperatorCategoryAdminController extends CategoryAdminController
Line 31: protected $controller_name = 'operator_category';
Line 35: * The view to use for editing existing category records
Line 37: protected $edit_view_name = 'sprout/admin/operator_category_edit';
Line 65: // Remove category controllers, use controller friendly name
Line 68: if ($reflect->isSubclassOf('Sprout\\Controllers\\Admin\\CategoryAdminController')) {
Line 81: $view->data['multiedit_permissions'] = MultiEdit::load('operatorcategory_permissions', ['operatorcategory_id' => $item_id], 'controller');
Line 89: FROM ~operatorcategory_subsites
Line 90: WHERE ~operatorcategory_subsites.operatorcategory_id = ?";
Line 102: $q = "SELECT manage_category_id
Line 103: FROM ~operatorcategory_manage_categories
Line 104: WHERE operatorcategory_id = ?";
Line 175: $update_fields['operatorcategory_id'] = $item_id;
Line 191: $this->replaceSet('operatorcategory_permissions', $new_set, ['operatorcategory_id' => $item_id]);
Line 201: $update_fields['operatorcategory_id'] = $item_id;
Line 207: $this->replaceSet('operatorcategory_subsites', $new_set, ['operatorcategory_id' => $item_id]);
Line 214: foreach ($_POST['manage_categories'] as $idx => $category_id) {
Line 216: $update_fields['manage_category_id'] = (int) $category_id;
Line 217: $update_fields['operatorcategory_id'] = $item_id;
Line 223: $this->replaceSet('operatorcategory_manage_categories', $new_set, ['operatorcategory_id' => $item_id]);

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

Line 29: class OperatorCategoryAdminController extends CategoryAdminController
Line 31: protected $controller_name = 'operator_category';
Line 35: * The view to use for editing existing category records
Line 37: protected $edit_view_name = 'sprout/admin/operator_category_edit';
Line 65: // Remove category controllers, use controller friendly name
Line 68: if ($reflect->isSubclassOf('Sprout\\Controllers\\Admin\\CategoryAdminController')) {
Line 81: $view->data['multiedit_permissions'] = MultiEdit::load('operatorcategory_permissions', ['operatorcategory_id' => $item_id], 'controller');
Line 89: FROM ~operatorcategory_subsites
Line 90: WHERE ~operatorcategory_subsites.operatorcategory_id = ?";
Line 102: $q = "SELECT manage_category_id
Line 103: FROM ~operatorcategory_manage_categories
Line 104: WHERE operatorcategory_id = ?";
Line 175: $update_fields['operatorcategory_id'] = $item_id;
Line 191: $this->replaceSet('operatorcategory_permissions', $new_set, ['operatorcategory_id' => $item_id]);
Line 201: $update_fields['operatorcategory_id'] = $item_id;
Line 207: $this->replaceSet('operatorcategory_subsites', $new_set, ['operatorcategory_id' => $item_id]);
Line 214: foreach ($_POST['manage_categories'] as $idx => $category_id) {
Line 216: $update_fields['manage_category_id'] = (int) $category_id;
Line 217: $update_fields['operatorcategory_id'] = $item_id;
Line 223: $this->replaceSet('operatorcategory_manage_categories', $new_set, ['operatorcategory_id' => $item_id]);

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

Line 31: use Sprout\Helpers\Category;
Line 273: $view->admin_category_options = AdminAuth::getAllCategories();
Line 274: $view->user_category_options = UserPerms::getAllCategories();
Line 414: $update_fields['category_id'] = $id;
Line 430: $update_fields['category_id'] = $id;
Line 682: $cat_id = Category::lookupOrCreate('files', 'Imported document images');
Line 708: Category::insertInto('files', $file_id, $cat_id);
Line 1143: $view->admin_category_options = AdminAuth::getAllCategories();
Line 1145: $view->user_category_options = UserPerms::getAllCategories();
Line 1678: $update_fields['category_id'] = $id;
Line 1697: $update_fields['category_id'] = $id;

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

Line 31: use Sprout\Helpers\Category;
Line 273: $view->admin_category_options = AdminAuth::getAllCategories();
Line 274: $view->user_category_options = UserPerms::getAllCategories();
Line 414: $update_fields['category_id'] = $id;
Line 430: $update_fields['category_id'] = $id;
Line 682: $cat_id = Category::lookupOrCreate('files', 'Imported document images');
Line 708: Category::insertInto('files', $file_id, $cat_id);
Line 1143: $view->admin_category_options = AdminAuth::getAllCategories();
Line 1145: $view->user_category_options = UserPerms::getAllCategories();
Line 1678: $update_fields['category_id'] = $id;
Line 1697: $update_fields['category_id'] = $id;

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

Line 45: * Gets the list of controllers which can have per-category permissions set
Line 65: // Ignore category controllers
Line 66: if ($reflect->isSubclassOf('Sprout\\Controllers\\Admin\\CategoryAdminController')) {
Line 209: unset($all_cats[AdminAuth::getPrimaryCategoryId()]);

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

Line 45: * Gets the list of controllers which can have per-category permissions set
Line 65: // Ignore category controllers
Line 66: if ($reflect->isSubclassOf('Sprout\\Controllers\\Admin\\CategoryAdminController')) {
Line 209: unset($all_cats[AdminAuth::getPrimaryCategoryId()]);

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

Line 19: class RedirectCategoryAdminController extends CategoryAdminController
Line 21: protected $controller_name = 'redirect_category';

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

Line 19: class RedirectCategoryAdminController extends CategoryAdminController
Line 21: protected $controller_name = 'redirect_category';

/sprout/Controllers/AdminAjaxController.php   Highlighted file source

Line 266: * Adds a category
Line 268: public function addCategory()
Line 276: if ($_POST['name'] == '') Json::error('Please enter a category name to add');

/sprout/Controllers/AdminAjaxController.php   Highlighted file source

Line 266: * Adds a category
Line 268: public function addCategory()
Line 276: if ($_POST['name'] == '') Json::error('Please enter a category name to add');

/sprout/Controllers/AdminController.php   Highlighted file source

Line 24: use Sprout\Controllers\Admin\CategoryAdminController;
Line 36: use Sprout\Helpers\Category;
Line 318: // Permissions system requires users to be in a category
Line 320: $cats = Category::categoryList('operators', AdminAuth::getId());
Line 829: if ($ctlr instanceof CategoryAdminController) {
Line 877: $cat_clause = PerRecordPerms::getCategoryClause();
Line 1014: // Don't display primary administrators category; they always get access
Line 1015: $primary_cat_id = AdminAuth::getPrimaryCategoryId();
Line 1024: if (!AdminAuth::inCategory($primary_cat_id)) {
Line 1031: if ($item_id == 0 or AdminAuth::inCategory($primary_cat_id)) {
Line 1036: if (AdminAuth::inCategory($primary_cat_id)) {

/sprout/Controllers/AdminController.php   Highlighted file source

Line 24: use Sprout\Controllers\Admin\CategoryAdminController;
Line 36: use Sprout\Helpers\Category;
Line 318: // Permissions system requires users to be in a category
Line 320: $cats = Category::categoryList('operators', AdminAuth::getId());
Line 829: if ($ctlr instanceof CategoryAdminController) {
Line 877: $cat_clause = PerRecordPerms::getCategoryClause();
Line 1014: // Don't display primary administrators category; they always get access
Line 1015: $primary_cat_id = AdminAuth::getPrimaryCategoryId();
Line 1024: if (!AdminAuth::inCategory($primary_cat_id)) {
Line 1031: if ($item_id == 0 or AdminAuth::inCategory($primary_cat_id)) {
Line 1036: if (AdminAuth::inCategory($primary_cat_id)) {

/sprout/Controllers/Controller.php   Highlighted file source

Line 61: * 'Add category' should contain ['cat_id' => value]
Line 62: * 'Delete category' should contain ['cat_id' => value]
Line 183: * Logs the adding of a record to a category. This is a wrapper for {@see Controller::logAction}
Line 185: * @param int $record_id The ID of the record which was added to the category
Line 186: * @param int $cat_id The ID of the category which the record was added to
Line 190: protected function logAddCategory($table, $record_id, $cat_id)
Line 192: return $this->logAction($table, $record_id, 'Add category', ['cat_id' => $cat_id]);
Line 229: * Logs the removal of a record from a category. This is a wrapper for {@see Controller::logAction}
Line 230: * @param string $table The table which contains the record which was removed from the category
Line 231: * @param int $record_id The ID of the record which was removed from the category
Line 232: * @param int $cat_id The ID of the category which the record was removed from
Line 236: protected function logDeleteCategory($table, $record_id, $cat_id)
Line 238: return $this->logAction($table, $record_id, 'Delete category', ['cat_id' => $cat_id]);

/sprout/Controllers/Controller.php   Highlighted file source

Line 61: * 'Add category' should contain ['cat_id' => value]
Line 62: * 'Delete category' should contain ['cat_id' => value]
Line 183: * Logs the adding of a record to a category. This is a wrapper for {@see Controller::logAction}
Line 185: * @param int $record_id The ID of the record which was added to the category
Line 186: * @param int $cat_id The ID of the category which the record was added to
Line 190: protected function logAddCategory($table, $record_id, $cat_id)
Line 192: return $this->logAction($table, $record_id, 'Add category', ['cat_id' => $cat_id]);
Line 229: * Logs the removal of a record from a category. This is a wrapper for {@see Controller::logAction}
Line 230: * @param string $table The table which contains the record which was removed from the category
Line 231: * @param int $record_id The ID of the record which was removed from the category
Line 232: * @param int $cat_id The ID of the category which the record was removed from
Line 236: protected function logDeleteCategory($table, $record_id, $cat_id)
Line 238: return $this->logAction($table, $record_id, 'Delete category', ['cat_id' => $cat_id]);

/sprout/Controllers/Tinymce4Controller.php   Highlighted file source

Line 22: use Sprout\Helpers\Category;
Line 94: $cat_table = Category::tableMain2cat('files');
Line 95: $joiner_table = Category::tableMain2joiner('files');
Line 113: $outer->page_title = 'Insert image - choose category';
Line 122: * Show a gallery of images for a given category
Line 124: public function imageList($category_id)
Line 127: $category_id = (int) $category_id;
Line 129: $cat_name = Category::name('files', $category_id);
Line 131: $cat_table = Category::tableMain2cat('files');
Line 132: $joiner_table = Category::tableMain2joiner('files');
Line 140: $res = Pdb::q($q, [$category_id, FileConstants::TYPE_IMAGE], 'pdo');
Line 147: $view->link_attrs = array('category_id' => $category_id);
Line 200: $_GET['category_id'] = (int) @$_GET['category_id'];
Line 222: if (!empty($_GET['category_id'])) {
Line 223: $up_url = 'SITE/tinymce4/image_list/' . $_GET['category_id'];
Line 384: $cat_table = Category::tableMain2cat('files');
Line 385: $joiner_table = Category::tableMain2joiner('files');
Line 403: $outer->page_title = 'Insert video - choose category';
Line 412: * Show a gallery of videos for a given category
Line 414: public function videoList($category_id)
Line 417: $category_id = (int) $category_id;
Line 419: $cat_name = Category::name('files', $category_id);
Line 421: $cat_table = Category::tableMain2cat('files');
Line 422: $joiner_table = Category::tableMain2joiner('files');
Line 431: $res = Pdb::q($q, [FileConstants::TYPE_VIDEO, $category_id], 'pdo');
Line 438: $view->link_attrs = ['category_id' => $category_id];
Line 512: $cat_table = Category::tableMain2cat('files');
Line 530: $cat_table = Category::tableMain2cat('files');
Line 531: $joiner_table = Category::tableMain2joiner('files');
Line 555: $outer->page_title = 'Insert Gallery - choose category';

/sprout/Controllers/Tinymce4Controller.php   Highlighted file source

Line 22: use Sprout\Helpers\Category;
Line 94: $cat_table = Category::tableMain2cat('files');
Line 95: $joiner_table = Category::tableMain2joiner('files');
Line 113: $outer->page_title = 'Insert image - choose category';
Line 122: * Show a gallery of images for a given category
Line 124: public function imageList($category_id)
Line 127: $category_id = (int) $category_id;
Line 129: $cat_name = Category::name('files', $category_id);
Line 131: $cat_table = Category::tableMain2cat('files');
Line 132: $joiner_table = Category::tableMain2joiner('files');
Line 140: $res = Pdb::q($q, [$category_id, FileConstants::TYPE_IMAGE], 'pdo');
Line 147: $view->link_attrs = array('category_id' => $category_id);
Line 200: $_GET['category_id'] = (int) @$_GET['category_id'];
Line 222: if (!empty($_GET['category_id'])) {
Line 223: $up_url = 'SITE/tinymce4/image_list/' . $_GET['category_id'];
Line 384: $cat_table = Category::tableMain2cat('files');
Line 385: $joiner_table = Category::tableMain2joiner('files');
Line 403: $outer->page_title = 'Insert video - choose category';
Line 412: * Show a gallery of videos for a given category
Line 414: public function videoList($category_id)
Line 417: $category_id = (int) $category_id;
Line 419: $cat_name = Category::name('files', $category_id);
Line 421: $cat_table = Category::tableMain2cat('files');
Line 422: $joiner_table = Category::tableMain2joiner('files');
Line 431: $res = Pdb::q($q, [FileConstants::TYPE_VIDEO, $category_id], 'pdo');
Line 438: $view->link_attrs = ['category_id' => $category_id];
Line 512: $cat_table = Category::tableMain2cat('files');
Line 530: $cat_table = Category::tableMain2cat('files');
Line 531: $joiner_table = Category::tableMain2joiner('files');
Line 555: $outer->page_title = 'Insert Gallery - choose category';

/sprout/Helpers/Admin.php   Highlighted file source

Line 459: public static function setCategoryTablename($name)
Line 464: public static function setCategorySinglecat($value)
Line 473: * @param $data An array of key-value pairs, with the keys being the id of the category, and the value being the name.
Line 474: * @param $selected An array of selected category ids.
Line 476: public static function categorySelection($field, $data, $selected)
Line 479: echo '<p>ERROR: <code>Admin::setCategoryTablename()</code> has not been called.</p>';
Line 496: echo "<div class=\"checkbox-list category-selection\">\n";
Line 528: // Show category quickadd, if allowed
Line 529: $controller = Inflector::singular(Category::tableCat2main(self::$cat_tablename));
Line 534: echo '<div class="field-label"><label for="onthefly-catadd">Add a new category</label></div>';
Line 535: echo '<div class="field-input"><input type="text" id="onthefly-catadd" spellcheck="true" class="textbox" placeholder="Category name"></div>';

/sprout/Helpers/AdminAuth.php   Highlighted file source

Line 34: private static $category_cache = [];
Line 425: * Returns true if the currently logged in user is in the specified category.
Line 428: * @param int $category_id The category to check
Line 430: public static function inCategory($category_id)
Line 437: $category_id = (int) $category_id;
Line 439: if (array_key_exists($category_id, static::$category_cache)) {
Line 440: return static::$category_cache[$category_id];
Line 446: $hascat = Pdb::q($q, [$_SESSION[self::KEY]['login_id'], $category_id], 'arr');
Line 448: if (count($hascat) == 0) static::$category_cache[$category_id] = false;
Line 449: else static::$category_cache[$category_id] = true;
Line 451: return static::$category_cache[$category_id];
Line 510: * Get the ID of the 'Primary administrators' category
Line 512: * i.e. the first category with permission to manage operators
Line 515: * @throws RowMissingException If there's no such category (in which case the system will be unuseable)
Line 517: public static function getPrimaryCategoryId()

/sprout/Helpers/AdminPerms.php   Highlighted file source

Line 78: * @return array Integers, one per category of operator which has access
Line 90: $q = "SELECT tbl.parent_id, tbl.admin_perm_type, perms.category_id
Line 108: // Grab the category IDs from the resultset fetched earlier
Line 111: if ($row['category_id']) {
Line 112: $items[] = $row['category_id'];
Line 218: // If set to default (ie all) on any category then grant all subsites
Line 238: $where = Pdb::buildClause([['operatorcategory_id', 'IN', $cats]], $params);
Line 240: FROM ~operatorcategory_subsites
Line 340: $conditions = [['operatorcategory_id', 'IN', $cat_ids], 'controller' => $controller];
Line 343: FROM ~operatorcategory_permissions
Line 391: $conditions = [['operatorcategory_id', 'IN', $cat_ids], ['controller', 'IN', $controllers]];
Line 394: FROM ~operatorcategory_permissions
Line 474: $cats_table = Category::tableMain2cat('operators');
Line 485: $joiner_table = Category::tableMain2joiner('operators');
Line 490: INNER JOIN ~operatorcategory_manage_categories AS manage ON manage.manage_category_id = cat.id
Line 491: INNER JOIN ~{$joiner_table} AS joiner ON manage.operatorcategory_id = joiner.cat_id
Line 512: $record_cats = Category::categoryList('operators', $operator_id);

/sprout/Helpers/AdminPerms.php   Highlighted file source

Line 78: * @return array Integers, one per category of operator which has access
Line 90: $q = "SELECT tbl.parent_id, tbl.admin_perm_type, perms.category_id
Line 108: // Grab the category IDs from the resultset fetched earlier
Line 111: if ($row['category_id']) {
Line 112: $items[] = $row['category_id'];
Line 218: // If set to default (ie all) on any category then grant all subsites
Line 238: $where = Pdb::buildClause([['operatorcategory_id', 'IN', $cats]], $params);
Line 240: FROM ~operatorcategory_subsites
Line 340: $conditions = [['operatorcategory_id', 'IN', $cat_ids], 'controller' => $controller];
Line 343: FROM ~operatorcategory_permissions
Line 391: $conditions = [['operatorcategory_id', 'IN', $cat_ids], ['controller', 'IN', $controllers]];
Line 394: FROM ~operatorcategory_permissions
Line 474: $cats_table = Category::tableMain2cat('operators');
Line 485: $joiner_table = Category::tableMain2joiner('operators');
Line 490: INNER JOIN ~operatorcategory_manage_categories AS manage ON manage.manage_category_id = cat.id
Line 491: INNER JOIN ~{$joiner_table} AS joiner ON manage.operatorcategory_id = joiner.cat_id
Line 512: $record_cats = Category::categoryList('operators', $operator_id);

/sprout/Helpers/Category.php   Highlighted file source

Line 22: class Category
Line 26: * Creates a category.
Line 30: * @param string $name The name of the category to add
Line 43: * Looks up a category.
Line 47: * @param string $name The name of the category to find
Line 74: * Looks up a category. If not found, creates the category.
Line 78: * @param string $name The name of the category to find or add
Line 94: * Get the name of a category based on the category id
Line 98: * @param string $id The ID of the category to get the name of
Line 99: * @param string The category name
Line 117: * Converts a main table name into a category table name.
Line 121: * @return string Category table name, e.g. 'articles_cat_list'
Line 159: * Converts a category table (e.g. 'articles_cat_list') into a main table (e.g. 'articles')
Line 162: * @param string $table Category table name, e.g. 'articles_cat_list'
Line 175: * Inserts a record into a category.
Line 178: * @param int $category_id The id in the category table.
Line 179: * @return bool True if adding the record to the category succeeded
Line 181: public static function insertInto($table, $record_id, $category_id)
Line 185: $category_col = 'cat_id';
Line 189: $update_data[$category_col] = $category_id;
Line 202: * Removes a record from a category.
Line 207: * @param int $category_id The id in the category table.
Line 209: public static function removefrom($table, $record_id, $category_id)
Line 213: $category_col = 'cat_id';
Line 217: $conditions[$category_col] = $category_id;
Line 230: * Does a given category contatin a given record?
Line 235: * @param int $category_id The id in the category table.
Line 237: public static function contains($table, $record_id, $category_id)
Line 240: $category_id = (int) $category_id;
Line 244: $category_col = 'cat_id';
Line 247: WHERE {$record_col} = ? AND {$category_col} = ?";
Line 248: $res = Pdb::q($q, [$record_id, $category_id], 'arr');
Line 257: * Return an array of IDs of records in a given category.
Line 261: * @param int $category_id The id in the category table.
Line 263: public static function recordList($table, $category_id)
Line 265: $category_id = (int) $category_id;
Line 269: $category_col = 'cat_id';
Line 271: $q = "SELECT {$record_col} AS id FROM ~{$table_joiner} WHERE {$category_col} = ?";
Line 272: return Pdb::q($q, [$category_id], 'col');
Line 283: public static function categoryList($table, $record_id)

/sprout/Helpers/DisplayConditions/Platform/DeviceCategory.php   Highlighted file source

Line 21: * Display condtion for device category - desktop, mobile, tablet
Line 23: class DeviceCategory extends DisplayConditionEnum
Line 51: return @$info['device_category'];

/sprout/Helpers/DisplayConditions/Platform/DeviceCategory.php   Highlighted file source

Line 21: * Display condtion for device category - desktop, mobile, tablet
Line 23: class DeviceCategory extends DisplayConditionEnum
Line 51: return @$info['device_category'];

/sprout/Helpers/Fb.php   Highlighted file source

Line 604: * 'req_category': (int) Category field required. Default of 1: required. 0: not required
Line 615: $options['req_category'] = isset($options['req_category']) ? (int) $options['req_category'] : 1;
Line 632: $out .= ' data-init="false" data-filename="' . Enc::html($filename) . '" data-req-category="' . Enc::html($options['req_category']) . '">';

/sprout/Helpers/Fb.php   Highlighted file source

Line 604: * 'req_category': (int) Category field required. Default of 1: required. 0: not required
Line 615: $options['req_category'] = isset($options['req_category']) ? (int) $options['req_category'] : 1;
Line 632: $out .= ' data-init="false" data-filename="' . Enc::html($filename) . '" data-req-category="' . Enc::html($options['req_category']) . '">';

/sprout/Helpers/PerRecordPerms.php   Highlighted file source

Line 60: public static function getCategoryClause()
Line 133: $cat_ids[] = AdminAuth::getPrimaryCategoryId();

/sprout/Helpers/PerRecordPerms.php   Highlighted file source

Line 60: public static function getCategoryClause()
Line 133: $cat_ids[] = AdminAuth::getPrimaryCategoryId();

/sprout/Helpers/RteLibraryHasCategories.php   Highlighted file source

Line 96: $cat_table = Category::tableMain2cat($this->main_table);
Line 97: $joiner_table = Category::tableMain2joiner($this->main_table);
Line 98: $joiner_col = Category::columnMain2joiner($this->main_table);
Line 101: // An empty "path", so return the category list

/sprout/Helpers/UserAgent.php   Highlighted file source

Line 62: public static function getDeviceCategory() {
Line 64: return self::$info['device_category'];
Line 70: return 'dc-' . self::getDeviceCategory();
Line 96: * 'device_category'
Line 111: 'dc' => 'device_category',

/sprout/Helpers/UserAgent.php   Highlighted file source

Line 62: public static function getDeviceCategory() {
Line 64: return self::$info['device_category'];
Line 70: return 'dc-' . self::getDeviceCategory();
Line 96: * 'device_category'
Line 111: 'dc' => 'device_category',

/sprout/Models/CategoryModel.php   Highlighted file source

Line 5: use Sprout\Helpers\Category;
Line 11: class CategoryModel extends Collection
Line 63: $cat_table = Category::tableMain2cat($main_table);
Line 64: $join_table = Category::tableMain2joiner($main_table);
Line 114: $cat_table = Category::tableMain2cat($main_table);
Line 163: $cat_table = Category::tableMain2cat($main_table);

/sprout/Models/CategoryModel.php   Highlighted file source

Line 5: use Sprout\Helpers\Category;
Line 11: class CategoryModel extends Collection
Line 63: $cat_table = Category::tableMain2cat($main_table);
Line 64: $join_table = Category::tableMain2joiner($main_table);
Line 114: $cat_table = Category::tableMain2cat($main_table);
Line 163: $cat_table = Category::tableMain2cat($main_table);

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

Line 19: 'SNAME_category' => 'Admin\CNAMECategoryAdminController',

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

Line 16: use Sprout\Controllers\Admin\CategoryAdminController;
Line 22: class CNAMECategoryAdminController extends CategoryAdminController
Line 24: protected $controller_name = 'SNAME_category';

/sprout/sprout_load.php   Highlighted file source

Line 63: Register::displayCondition('Sprout\\Helpers\\DisplayConditions\\Platform\\DeviceCategory', 'Platform', 'Device category');

/sprout/sprout_load.php   Highlighted file source

Line 63: Register::displayCondition('Sprout\\Helpers\\DisplayConditions\\Platform\\DeviceCategory', 'Platform', 'Device category');

/sprout/tests/categoryTest.php   Highlighted file source

Line 14: use Sprout\Helpers\Category;
Line 21: class categoryTest extends PHPUnit_Framework_TestCase
Line 44: Category::tableMain2cat($val);
Line 53: Category::tableMain2joiner($val);
Line 62: Category::tableCat2main($val);
Line 80: $this->assertInternalType('string', Category::tableMain2cat($val));
Line 88: $this->assertInternalType('string', Category::tableMain2joiner($val));
Line 96: $this->assertInternalType('string', Category::tableCat2main($val));

/sprout/tests/categoryTest.php   Highlighted file source

Line 14: use Sprout\Helpers\Category;
Line 21: class categoryTest extends PHPUnit_Framework_TestCase
Line 44: Category::tableMain2cat($val);
Line 53: Category::tableMain2joiner($val);
Line 62: Category::tableCat2main($val);
Line 80: $this->assertInternalType('string', Category::tableMain2cat($val));
Line 88: $this->assertInternalType('string', Category::tableMain2joiner($val));
Line 96: $this->assertInternalType('string', Category::tableCat2main($val));

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

Line 28: <a class="icon-after icon-add button button-small" href="admin/add/<?php echo Enc::html($controller_name . '_category'); ?>" rel="facebox">Add category</a>
Line 33: $class = (@$_GET['_category_id'] === null ? 'all active-node' : 'all');
Line 46: $class = (@$_GET['_category_id'] === $cat['id'] ? 'category active-node' : 'category');
Line 51: <a class="node-link" href="admin/contents/<?php echo $controller_name; ?>?_category_id=<?php echo $cat['id']; ?>" rel="<?php echo $cat['id']; ?>"><?php echo $name; ?> <span class="tree-list-count"><?php echo $cat['num_items']; ?></span></a>
Line 57: <a href="admin/contents/<?php echo $controller_name; ?>?_category_id=<?php echo $cat['id']; ?>">View <?php echo Inflector::plural('item', $cat['num_items']); ?></a>
Line 59: <?php if ($category_archive and $cat['id']): ?>
Line 62: <a href="admin/call/<?php echo $controller_name; ?>_category/ajaxArchiveAction/<?php echo $cat['id']; ?>">Archive Category</a>
Line 66: <a href="admin/call/<?php echo $controller_name; ?>_category/ajaxUnarchiveAction/<?php echo $cat['id']; ?>">Unarchive Category</a>
Line 71: <a href="admin/add/<?php echo $controller_name; ?>?category_id=<?php echo $cat['id']; ?>">Add item</a>
Line 75: <a href="admin/edit/<?php echo $controller_name; ?>_category/<?php echo $cat['id']; ?>">Edit</a>
Line 79: <a href="admin/extra/<?php echo $controller_name; ?>_category/reorder/<?php echo $cat['id']; ?>">Reorder</a>
Line 83: <a href="admin/delete/<?php echo $controller_name; ?>_category/<?php echo $cat['id']; ?>">Delete category</a>
Line 92: <?php if (isset($category_archive_type)): ?>
Line 93: <form class="sidebar-form category-archive-selection" method="get">
Line 94: <?php Fb::$data['category_type'] = $category_archive_type; ?>
Line 96: <?php echo Form::dropdown('category_type', ['-wrapper-class' => 'small white', 'placeholder' => 'Archive', 'title' => 'Select whether to show live categories, archived or everything.'], Constants::$category_admin_options); ?>
Line 100: $('.category-archive-selection select[name="category_type"]').change(function () {

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

Line 28: <a class="icon-after icon-add button button-small" href="admin/add/<?php echo Enc::html($controller_name . '_category'); ?>" rel="facebox">Add category</a>
Line 33: $class = (@$_GET['_category_id'] === null ? 'all active-node' : 'all');
Line 46: $class = (@$_GET['_category_id'] === $cat['id'] ? 'category active-node' : 'category');
Line 51: <a class="node-link" href="admin/contents/<?php echo $controller_name; ?>?_category_id=<?php echo $cat['id']; ?>" rel="<?php echo $cat['id']; ?>"><?php echo $name; ?> <span class="tree-list-count"><?php echo $cat['num_items']; ?></span></a>
Line 57: <a href="admin/contents/<?php echo $controller_name; ?>?_category_id=<?php echo $cat['id']; ?>">View <?php echo Inflector::plural('item', $cat['num_items']); ?></a>
Line 59: <?php if ($category_archive and $cat['id']): ?>
Line 62: <a href="admin/call/<?php echo $controller_name; ?>_category/ajaxArchiveAction/<?php echo $cat['id']; ?>">Archive Category</a>
Line 66: <a href="admin/call/<?php echo $controller_name; ?>_category/ajaxUnarchiveAction/<?php echo $cat['id']; ?>">Unarchive Category</a>
Line 71: <a href="admin/add/<?php echo $controller_name; ?>?category_id=<?php echo $cat['id']; ?>">Add item</a>
Line 75: <a href="admin/edit/<?php echo $controller_name; ?>_category/<?php echo $cat['id']; ?>">Edit</a>
Line 79: <a href="admin/extra/<?php echo $controller_name; ?>_category/reorder/<?php echo $cat['id']; ?>">Reorder</a>
Line 83: <a href="admin/delete/<?php echo $controller_name; ?>_category/<?php echo $cat['id']; ?>">Delete category</a>
Line 92: <?php if (isset($category_archive_type)): ?>
Line 93: <form class="sidebar-form category-archive-selection" method="get">
Line 94: <?php Fb::$data['category_type'] = $category_archive_type; ?>
Line 96: <?php echo Form::dropdown('category_type', ['-wrapper-class' => 'small white', 'placeholder' => 'Archive', 'title' => 'Select whether to show live categories, archived or everything.'], Constants::$category_admin_options); ?>
Line 100: $('.category-archive-selection select[name="category_type"]').change(function () {

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

Line 56: Form::nextFieldDetails('Category', false);
Line 57: echo Form::dropdown('category_id', ['-dropdown-top' => 'Choose per file'], Pdb::lookup('files_cat_list'));

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

Line 56: Form::nextFieldDetails('Category', false);
Line 57: echo Form::dropdown('category_id', ['-dropdown-top' => 'Choose per file'], Pdb::lookup('files_cat_list'));

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

Line 65: Form::nextFieldDetails('Category', true);
Line 66: echo Form::dropdown('category_id', [], $categories);

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

Line 65: Form::nextFieldDetails('Category', true);
Line 66: echo Form::dropdown('category_id', [], $categories);

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

Line 52: Form::nextFieldDetails('Category', false);
Line 53: echo Form::dropdown('category_id', ['-dropdown-top' => 'All', '-wrapper-class' => 'white'], $cats);
Line 99: $cats = ['_new' => '- New category -'] + $cats;
Line 101: Form::nextFieldDetails('Category', (bool) $req_category);
Line 102: echo Form::dropdown('category_id', ['-dropdown-top' => 'Select a file category', '-wrapper-class' => 'white select-category'], $cats);
Line 106: Form::nextFieldDetails('New file category', true);
Line 107: echo Form::text('category_new', ['-wrapper-class' => 'white new-category', 'placeholder' => 'Enter a category name']);

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

Line 52: Form::nextFieldDetails('Category', false);
Line 53: echo Form::dropdown('category_id', ['-dropdown-top' => 'All', '-wrapper-class' => 'white'], $cats);
Line 99: $cats = ['_new' => '- New category -'] + $cats;
Line 101: Form::nextFieldDetails('Category', (bool) $req_category);
Line 102: echo Form::dropdown('category_id', ['-dropdown-top' => 'Select a file category', '-wrapper-class' => 'white select-category'], $cats);
Line 106: Form::nextFieldDetails('New file category', true);
Line 107: echo Form::text('category_new', ['-wrapper-class' => 'white new-category', 'placeholder' => 'Enter a category name']);

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

Line 26: <h3 class="h2">Category name</h3>
Line 55: This allows for fine-graned control of the admin tabs which are available to operators in this category.
Line 98: Specify the subsites that operators of this category can manage content for.

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

Line 26: <h3 class="h2">Category name</h3>
Line 55: This allows for fine-graned control of the admin tabs which are available to operators in this category.
Line 98: Specify the subsites that operators of this category can manage content for.

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

Line 25: $actions['admin/add/' . $controller_name . '?category_id=%%'] = 'Add ' . Inflector::singular($friendly_name);
Line 28: $actions['admin/edit/' . $controller_name . '_category/%%'] = 'Edit category options';
Line 29: $actions['admin/delete/' . $controller_name . '_category/%%'] = 'Delete category';
Line 38: // Category actions box
Line 39: $('li.category a').mouseup(function(event) {
Line 44: var html = '<h3>Category actions</h3>';
Line 55: $('li.category a').each(function(i) {
Line 66: <a class="icon-after icon-add button button-small" href="admin/add/<?php echo $controller_name . '_category'; ?>">Add category</a>
Line 80: $class = (@$_GET['_category_id'] == $id ? 'category current-edit' : 'category'); ?>
Line 85: <a class="node-link" href="admin/contents/<?php echo $controller_name; ?>?_category_id=<?php echo $id; ?>"><?php echo $name; ?></a>
Line 94: <a href="#">Delete category</a>

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

Line 25: $actions['admin/add/' . $controller_name . '?category_id=%%'] = 'Add ' . Inflector::singular($friendly_name);
Line 28: $actions['admin/edit/' . $controller_name . '_category/%%'] = 'Edit category options';
Line 29: $actions['admin/delete/' . $controller_name . '_category/%%'] = 'Delete category';
Line 38: // Category actions box
Line 39: $('li.category a').mouseup(function(event) {
Line 44: var html = '<h3>Category actions</h3>';
Line 55: $('li.category a').each(function(i) {
Line 66: <a class="icon-after icon-add button button-small" href="admin/add/<?php echo $controller_name . '_category'; ?>">Add category</a>
Line 80: $class = (@$_GET['_category_id'] == $id ? 'category current-edit' : 'category'); ?>
Line 85: <a class="node-link" href="admin/contents/<?php echo $controller_name; ?>?_category_id=<?php echo $id; ?>"><?php echo $name; ?></a>
Line 94: <a href="#">Delete category</a>

/sprout/views/gallery_widget_settings.php   Highlighted file source

Line 12: Form::nextFieldDetails('Category', true);
Line 13: echo Form::dropdown('category', [], $cats);

/sprout/views/gallery_widget_settings.php   Highlighted file source

Line 12: Form::nextFieldDetails('Category', true);
Line 13: echo Form::dropdown('category', [], $cats);

/sprout/views/tinymce4/image_gallery.php   Highlighted file source

Line 37: $category_name = '';
Line 38: foreach ($categories as $category) {
Line 39: if ($data['cat'] == $category['id']) {
Line 40: $category_name = $category['name'];
Line 50: 5 => 'Manual (in category options)',
Line 157: <?php if (!empty($category_name)): ?>Currently chosen <strong><?php echo Enc::html($category_name); ?></strong>.<?php endif; ?>
Line 158: Choose a category of images from the gallery below to save changes.
Line 163: <?php foreach ($categories as $category): ?>
Line 165: $thumbs = explode('|', $category['filenames']);
Line 169: <a href="javascript:;" data-id="<?php echo Enc::html($category['id']); ?>" data-title="<?php echo Enc::html($category['name']); ?>" class="js-gallery-cat <?php if ($category['id'] == $data['cat']): echo 'active'; endif; ?>">
Line 183: <div class="name"><?php echo Enc::html($category['name']); ?></div>
Line 193: // Category thumb match height
Line 198: // Category thumb click event

/sprout/views/tinymce4/image_gallery.php   Highlighted file source

Line 37: $category_name = '';
Line 38: foreach ($categories as $category) {
Line 39: if ($data['cat'] == $category['id']) {
Line 40: $category_name = $category['name'];
Line 50: 5 => 'Manual (in category options)',
Line 157: <?php if (!empty($category_name)): ?>Currently chosen <strong><?php echo Enc::html($category_name); ?></strong>.<?php endif; ?>
Line 158: Choose a category of images from the gallery below to save changes.
Line 163: <?php foreach ($categories as $category): ?>
Line 165: $thumbs = explode('|', $category['filenames']);
Line 169: <a href="javascript:;" data-id="<?php echo Enc::html($category['id']); ?>" data-title="<?php echo Enc::html($category['name']); ?>" class="js-gallery-cat <?php if ($category['id'] == $data['cat']): echo 'active'; endif; ?>">
Line 183: <div class="name"><?php echo Enc::html($category['name']); ?></div>
Line 193: // Category thumb match height
Line 198: // Category thumb click event

/sprout/views/tinymce4/upload.php   Highlighted file source

Line 42: <?php Form::nextFieldDetails('Category', true); ?>
Line 43: <?= Form::dropdown('category_id', [], $cats); ?>
Line 93: $('#mce-upload select[name="category_id"]').change(function() {
Line 95: $(this).parent().html('<input name="category_new" class="emu-mce-input">');
Line 96: $('#mce-upload input[name="category_new"]').select();

/sprout/views/tinymce4/upload.php   Highlighted file source

Line 42: <?php Form::nextFieldDetails('Category', true); ?>
Line 43: <?= Form::dropdown('category_id', [], $cats); ?>
Line 93: $('#mce-upload select[name="category_id"]').change(function() {
Line 95: $(this).parent().html('<input name="category_new" class="emu-mce-input">');
Line 96: $('#mce-upload input[name="category_new"]').select();

/sprout/Widgets/FileListWidget.php   Highlighted file source

Line 41: $this->settings['category'] = (int) @$this->settings['category'];
Line 42: if ($this->settings['category'] == 0) return;
Line 51: $res = Pdb::query($q, [$this->settings['category']], 'arr');
Line 80: Form::nextFieldDetails('Category', true);
Line 81: $out .= Form::dropdown('category', [], $cats);
Line 96: if (empty($this->settings['category'])) return null;
Line 98: return 'admin/contents/file?_category_id=' . $this->settings['category'];
Line 108: if (empty($this->settings['category'])) return null;
Line 113: 'Category' => $cats[$this->settings['category']],

/sprout/Widgets/FileListWidget.php   Highlighted file source

Line 41: $this->settings['category'] = (int) @$this->settings['category'];
Line 42: if ($this->settings['category'] == 0) return;
Line 51: $res = Pdb::query($q, [$this->settings['category']], 'arr');
Line 80: Form::nextFieldDetails('Category', true);
Line 81: $out .= Form::dropdown('category', [], $cats);
Line 96: if (empty($this->settings['category'])) return null;
Line 98: return 'admin/contents/file?_category_id=' . $this->settings['category'];
Line 108: if (empty($this->settings['category'])) return null;
Line 113: 'Category' => $cats[$this->settings['category']],

/sprout/Widgets/ImageGalleryWidget.php   Highlighted file source

Line 44: 5 => 'Manual (in category options)',
Line 75: $this->settings['category'] = (int) @$this->settings['category'];
Line 76: if ($this->settings['category'] <= 0) return false;
Line 140: $res = Pdb::query($q, [$this->settings['category']], 'arr');
Line 271: if (empty($this->settings['category'])) return null;
Line 272: return 'admin/contents/file?_category_id=' . $this->settings['category'];
Line 282: if (empty($this->settings['category'])) return null;
Line 285: 'Category' => $cats[$this->settings['category']],
Line 334: 'category' => (int) $id[$i],

/sprout/Widgets/ImageGalleryWidget.php   Highlighted file source

Line 44: 5 => 'Manual (in category options)',
Line 75: $this->settings['category'] = (int) @$this->settings['category'];
Line 76: if ($this->settings['category'] <= 0) return false;
Line 140: $res = Pdb::query($q, [$this->settings['category']], 'arr');
Line 271: if (empty($this->settings['category'])) return null;
Line 272: return 'admin/contents/file?_category_id=' . $this->settings['category'];
Line 282: if (empty($this->settings['category'])) return null;
Line 285: 'Category' => $cats[$this->settings['category']],
Line 334: 'category' => (int) $id[$i],

A total of 889 lines in 76 files were found