function getStatusOptions() { $options = filterConstants('AMP_SCHEDULE_STATUS'); $result = array(); foreach (array_values($options) as $value) { $result[$value] = $value; } return $result; }
function getDisplayType($listType = null) { if (!isset($listType)) { $listType = $this->_section->getListType(); } $listTypes = filterConstants('AMP_SECTIONLIST'); if (!($display_type = array_search($listType, $listTypes))) { return "ARTICLES"; } return $display_type; }
function adjustFields($fields) { $blocks = filterConstants('AMP_CONTENT_NAV_BLOCK'); $tokens = array(AMP_CONTENT_TEMPLATE_TOKEN_BODY); $renderer = AMP_get_renderer(); foreach ($blocks as $block_name => $db_token) { $tokens[] = sprintf(AMP_CONTENT_TEMPLATE_TOKEN_STANDARD, strtolower($block_name)); } $fields['template_header2']['default'] = AMP_TEXT_TEMPLATE_ADD_TOKENS . $renderer->newline() . join(' ', $tokens); return $fields; }
function _getDisplayClass() { $result = AMP_PREFIX_SECTION_DISPLAY . $this->_manager->getContentsType(); $custom_displays = filterConstants('AMP_SECTION_DISPLAY'); if (isset($custom_displays[strtoupper($this->_manager->getDisplayType())])) { $result = $custom_displays[strtoupper($this->_manager->getDisplayType())]; } if (!class_exists($result)) { trigger_error(sprintf(AMP_TEXT_ERROR_NOT_DEFINED, 'AMP', $result)); return AMP_SECTION_DISPLAY_DEFAULT; } return $result; }
function getDescriptors() { return filterConstants('AMP_PERMISSION'); }
function get_display_class_names() { $displays = filterConstants('AMP_CONTENT_TAG_DISPLAY'); foreach ($this->dataset as $tag_id => $tag_name) { if (!isset($displays[$tag_id])) { $this->dataset = AMP_CONTENT_TAG_DISPLAY_DEFAULT; continue; } $this->dataset[$tag_id] = $displays[$tag_id]; } }
function setActivationLocation($loc) { $permitted_locations = filterConstants('AMP_MENU_ACTIVATION_LOCATION'); if (array_search($loc, $permitted_locations) === false) { return false; } $this->_activationLocation = $loc; }
/** * Returns the AMP 3.5 + designator for a list type * * This method is for legacy compatibility -- it handles the tricky stuff like changing type to section * -- feed it an old list type, get back a relevant one. To add translations, simply create * a constant AMP_CONTENT_LISTTYPE_( new list type ), and define it to the ( old list type ) that needs converting. * * @access public * @since 3.5.3 * @param string $listType a listType used by the old content system * @return string a listType used by the current content system */ function getBaseListType($listType) { /** * an array of listTypes defined in the current system * * @static * @var mixed * @access public */ static $listTypeSet = false; if (!$listTypeSet) { $listTypeSet = filterConstants('AMP_CONTENT_LISTTYPE'); } if ($base_type = array_search($listType, $listTypeSet)) { return strtolower($base_type); } return false; }
function init() { if (isset($this->_prefix_values)) { $this->dataset = array_flip(filterConstants($this->_prefix_values)); } if (isset($this->_prefix_labels)) { $this->_swapLabels(filterConstants($this->_prefix_labels)); } $this->_sort_default(); }