SCHLIX\cmsApplication_CategorizedList

Inherited from cmsApplication_List
Implements interface_cmsApplication_CategorizedList
Inherits Core_BlockManager, Core_CustomField, Core_EditorManager, Core_Menu, Landing, Tag, cmsApplication_HierarchicalTree_List

Protected Attributes

protected $_before_save_category_functions= []
protected $_after_save_category_functions= []
protected $_more_save_category_validations= []
protected $_checkSaveCategoryWritePermission= true
protected $sortable_category_fields= [ ['key' => 'cid', 'label' => 'Category ID'], ['key' => 'title', 'label' => 'Title'], ['key' => 'date_created', 'label' => 'Date Created'], ['key' => 'date_modified', 'label' => 'Date Modified'], ['key' => 'sort_order', 'label' => 'Sort Order'] ]
protected $default_category_options= array ('display_pagetitle','display_child_categories','display_items')
protected $category_meta_options 
protected $default_mainpage_options= array ('display_child_categories', 'display_items','display_item_summary_noread','display_item_created_by', 'display_item_date_created')
protected $_fieldname_categories 
protected $table_categories 
protected $field_category_id 
protected $field_category_title= 'title'
protected $view_template_item_file= 'view.item'
protected $view_template_category_file= 'view.category.simple'
protected $category_restore_keys_to_ignore 

Protected Methods

protected typemodifyDataValuesBeforeSaveCategory(array $datavalues)
Set default save category variables
protected onAfterSaveCategory(array $datavalues, array $original_datavalues, array $previous_category, array $retval)
Do something after save item.
protected arraymodifyDataValuesBeforeSaveItem(array $datavalues)
Override - modify data values before save item
protected fixSortableCategoryFields()
Translate label of sortable item fields and match it with item fields

Public Methods

public __construct($app_description, $table_items, $table_categories)
public arraygetAnyObjectByGUID(string $guid)
Returns an item or category with specified GUID $SystemDB
public increaseCategoryPageView($cid)
public resetCategoryPageView($cid)
public getTotalItemCountByCategoryID($category_id, $criteria='', $cache=false)
public getTotalCategoryCount($criteria='', $cache=false)
public getBreadCrumbsByCategoryID($cat_id)
public getBreadCrumbsByItemID($item_id)
public arrayinterpretFriendlyURL(string $urlpath)
Returns an array of command, given $urlpath.
public stringcreateFriendlyURL(string $str)
create SEO friendly URL. Format is action={...}¶m1={....}¶m2={...}
public getItemOrCategoryToViewFromFullVirtualFilename($url, $enable_redirect_no_trailingslash_folder=false)
public getFullPathByCategoryID($cat_id)
public getFullPathByItemID($item_id)
public intgetDefaultCategoryID()
Return the default category ID for save item operation $SystemDB
public stringgetCategoryTableName()
Returns the category's table name
public arraygetCategoryCustomFields()
Returns a list of custom fields for the item table
public getCategoryTable()
Returns the category's table
public arraygetCategoryFieldNames()
Returns the category field names
public stringgetFieldCategoryID()
Returns the primary key of category table, usually 'cid'
public stringgetFieldItemCategoryID()
Returns the foreign key in item's table that connects to the primary key of category table Usually 'category_id'
public getAllChildItemsInMultipleCategories($multiple_category_ids)
public getAllCategories($fields=' *', $extra_criteria='', $start, $end, $sortby='', $sortdirection='ASC')
public arraygetCategoryByID(int $id, bool $from_cache=false)
Returns a category by I $SystemDB
public getCategoryByIDWithExtraData($cid)
public arraygetCategoryByVirtualFilename(string $input_filename, int $parent_id=-1)
Typo but still needed for backward compatibility until 2.1.8 TODO: remove Deprecatedsince version 2.1.6-1 since version 2.1.6-1
public arraygetCategoriesByVirtualFilename(string $input_filename, int $parent_id=-1)
Return multiple categories given a possible virtual filename $SystemDB
public getItemsByCategoryID($id, $fields=' *', $extra_criteria='', $start, $end, $sortby='', $sortdirection='ASC', $from_cache=false)
public viewCategoryByID($id=1, $pg=1, $sortby='', $sortdirection='ASC', $standard_criteria='status, , $from_cache=false)
public delete($str)
Deletes items from table. The parameter $mixed_items_to_delete is a pipe-separated value of items, e.g. i4|i5|i1 $SystemDB
public boolcategoryColumnExists(string $fieldname)
Returns true if category table contains this column name
public nullrestoreCategory(int $cid, double $version)
Restores an item from global versioning
public bool|array String arraygetValidationErrorListBeforeSaveCategory(array $datavalues)
Validates save item. If there's an error, it will return an array with one or more error string, otherwise it will return a boolean true $CurrentUser
public booleanfindDuplicateCategories(array $datavalues)
Returns true if any element in $data has a duplicate with an existing category User override.
public booladdBeforeSaveCategoryValidationHook(object $object, string $function_name)
Add hook to before save category
public addAfterSaveCategoryFunctionHook(object $object, string $function_name)
Add hook to before save category
public booladdBeforeSaveCategoryFunctionHook(object $object, string $function_name)
Add hook to before save category. The function must receive be like this: $obj->function_name ($datavalues, $return_value_of_save)
public stringsaveCategory($cid, array $alternative_datavalues=NULL)
Saves the category to database. If id's type is string, it must only be 'new' cmsDatabase $SystemDB
public stringpreventDuplicateValueInItemTableUnderCategory(string $fieldname, string $possible_duplicate, int $id, int $category_id)
Returns a new name if there's an item with the same name in the specified $fieldname $SystemDB
public stringpreventDuplicateValueInCategory(string $fieldname, string $possible_duplicate, int $cid)
Returns a new name if there's an item with the same name in the specified $fieldname $SystemDB
public arraygetSortableCategoryColumns()
Returns a label/key pair array containing a list of sortable category fields
public arraygetDefaultCategoryMetaOptionKeys()
Returns an array of default category options. If it's not defined, the hardcoded property of default_category_options
public intgetDefaultCategoryItemsPerPage()
Returns the default number of items per page
public arraygetCategoryMetaOptionKeys()
Returns an array containing on array of main page options. In this base class, the key is almost similar to getCategoryMetaOptionKeys The values of the options will still be evaluated as a flat list array, however it is sectioned into array with the following keys: header, value, type, and options. Label: section title (not used for any evaluationType: checkboxgroup, dropdownlist, or none. If none, then it means there are suboptions which contain another array of thisKey: the key option. Please note that checkboxgroup doesn't have a key since the keys are in the optionsOptions: an array with 2 keys: label and key Label: section title (not used for any evaluation Type: checkboxgroup, dropdownlist, or none. If none, then it means there are suboptions which contain another array of this Key: the key option. Please note that checkboxgroup doesn't have a key since the keys are in the options Options: an array with 2 keys: label and key
public arraygetMainpageMetaOptionKeys()
Returns an array containing on array of main page options. The values of the options will still be evaluated as a flat list array, however it is sectioned into array with the following keys: header, value, type, and options. Label: section title (not used for any evaluationType: checkboxgroup, dropdownlist, or none. If none, then it means there are suboptions which contain another array of thisKey: the key option. Please note that checkboxgroup doesn't have a key since the keys are in the optionsOptions: an array with 2 keys: label and key Label: section title (not used for any evaluation Type: checkboxgroup, dropdownlist, or none. If none, then it means there are suboptions which contain another array of this Key: the key option. Please note that checkboxgroup doesn't have a key since the keys are in the options Options: an array with 2 keys: label and key
public booleanRun(array $command)
Run Command for routing. Main command is in $command['action']