public function getLabel($required = true) { $label = parent::getLabel(); if ($label == "") { return ""; } return $this->fetch('label.php', __CLASS__); }
public function PHPValidate($values) { if (isset($this->listing) && $this->listing->cat_id) { $params = JUDirectoryHelper::getParams($this->listing->cat_id); } else { $params = JUDirectoryHelper::getParams(null, $this->listing_id); } $maxTags = $params->get("max_tags_per_listing", 10); if ($maxTags) { $values = str_replace("|", ",", $values); $tags = explode(",", $values); if (count($tags) > $maxTags) { return JText::sprintf('COM_JUDIRECTORY_TOTAL_TAGS_OVER_MAX_X_TAGS', $maxTags); } } return parent::PHPValidate($values); }
public function onSearch(&$query, &$where, $search) { if ($search !== "") { if ($this->params->get("tag_search", 0)) { $search = explode(",", $search); } return parent::onSearch($query, $where, $search); } }
public function onSimpleSearch(&$query, &$where, $search) { $matched_options = array(); $options = $this->getPredefinedValues(); foreach ($options as $option) { if (strpos(mb_strtolower($search, 'UTF-8'), mb_strtolower($option->text, 'UTF-8')) !== false) { $matched_options[] = $option->value; } } parent::onSimpleSearch($query, $where, $matched_options); }
public function canEdit($userID = null) { $app = JFactory::getApplication(); if ($app->isSite()) { return false; } else { return parent::canEdit($userID); } }
public function canView($options = array()) { $params = JUDirectoryHelper::getParams(null, $this->listing_id); $default_image = JUDirectoryHelper::getDefaultListingImage(); if ($this->value == "" && $default_image) { $this->value = "default/" . $params->get('listing_default_image', 'default-listing.png'); } return parent::canView($options); }
public function filterField($value) { $return = parent::filterField($value); if ($this->params->get("strip_tags_before_save", 0)) { $allowable_tags = $this->params->get("allowable_tags", "u,b,i,a,ul,li,pre,blockquote,strong,em"); $allowable_tags = str_replace(' ', '', $allowable_tags); $allowable_tags = "<" . str_replace(',', '><', $allowable_tags) . ">"; $return = strip_tags($return, $allowable_tags); } return $return; }
public function isPublished() { $storeId = md5(__METHOD__ . "::" . $this->id); if (!isset(self::$cache[$storeId])) { $app = JFactory::getApplication(); if ($app->isAdmin()) { self::$cache[$storeId] = false; return self::$cache[$storeId]; } self::$cache[$storeId] = parent::isPublished(); return self::$cache[$storeId]; } return self::$cache[$storeId]; }