protected function metaAsShortDesc($i) { $metaAsShortDesc = iCFilterOutput::fullCleanHTML($i->metadesc); return $metaAsShortDesc; }
/** Systeme de navigation **/ function getNav($date_start, $modid) { $app = JFactory::getApplication(); $isSef = $app->getCfg('sef'); // Return Current URL $url = JUri::getInstance()->toString() . '#tag'; $url = preg_replace('/&iccaldate=[^&]*/', '', $url); $url = preg_replace('/\\?iccaldate=[^\\?]*/', '', $url); // Set Separator for Navigation Var $separator = strpos($url, '?') !== false ? '&' : '?'; // Remove fragment (hashtag could be added by a third party extension, eg. nonumber framework) $parsed_url = parse_url($url); $fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : ''; $url = str_replace($fragment, '', $url); // Return Current URL Filtered $url = htmlspecialchars($url); // Start Date $ex_date = explode('-', $date_start); $year = $ex_date[0]; $month = $ex_date[1]; $day = 1; if ($month != 1) { $backMonth = $month - 1; $backYear = $year; } elseif ($month == 1) { $backMonth = 12; $backYear = $year - 1; } if ($month != 12) { $nextMonth = $month + 1; $nextYear = $year; } elseif ($month == 12) { $nextMonth = 1; $nextYear = $year + 1; } $backYYear = $year - 1; $nextYYear = $year + 1; // Create Navigation Arrows $classBackYear = 'backicY icagendabtn_' . $modid; $urlBackYear = $url . $separator . 'iccaldate=' . $backYYear . '-' . $month . '-' . $day; $iconBackYear = '<span class="iCicon iCicon-backicY"></span>'; $backY = '<a class="' . $classBackYear . '" href="' . $urlBackYear . '" rel="nofollow">' . $iconBackYear . '</a>'; $classBackMonth = 'backic icagendabtn_' . $modid; $urlBackMonth = $url . $separator . 'iccaldate=' . $backYear . '-' . $backMonth . '-' . $day; $iconBackMonth = '<span class="iCicon iCicon-backic"></span>'; $back = '<a class="' . $classBackMonth . '" href="' . $urlBackMonth . '" rel="nofollow">' . $iconBackMonth . '</a>'; $classNextMonth = 'nextic icagendabtn_' . $modid; $urlNextMonth = $url . $separator . 'iccaldate=' . $nextYear . '-' . $nextMonth . '-' . $day; $iconNextMonth = '<span class="iCicon iCicon-nextic"></span>'; $next = '<a class="' . $classNextMonth . '" href="' . $urlNextMonth . '" rel="nofollow">' . $iconNextMonth . '</a>'; $classNextYear = 'nexticY icagendabtn_' . $modid; $urlNextYear = $url . $separator . 'iccaldate=' . $nextYYear . '-' . $month . '-' . $day; $iconNextYear = '<span class="iCicon iCicon-nexticY"></span>'; $nextY = '<a class="' . $classNextYear . '" href="' . $urlNextYear . '" rel="nofollow">' . $iconNextYear . '</a>'; if (!$this->month_nav) { $back = $next = ''; } if (!$this->year_nav) { $backY = $nextY = ''; } /** translate the month in the calendar module -- Leland Vandervort **/ $dateFormat = date('Y-m-d', strtotime($date_start)); // split out the month and year to obtain translation key for JText using joomla core translation $t_day = strftime("%d", strtotime("{$dateFormat}")); $t_month = date('F', strtotime($dateFormat)); $t_year = strftime("%Y", strtotime("{$dateFormat}")); $lang = JFactory::getLanguage(); $langTag = $lang->getTag(); $yearBeforeMonth = array('ar-AA', 'ja-JP'); $monthBeforeYear = in_array($langTag, $yearBeforeMonth) ? 0 : 1; /** * Get prefix, suffix and separator for month and year in calendar title */ // Separator Month/Year $separator_month_year = JText::_('SEPARATOR_MONTH_YEAR'); if ($separator_month_year == 'CALENDAR_SEPARATOR_MONTH_YEAR_FACULTATIVE') { $separator_month_year = ' '; } elseif ($separator_month_year == 'NO_SEPARATOR') { $separator_month_year = ''; } // Prefix Month (Facultative) $prefix_month = JText::_('PREFIX_MONTH'); if ($prefix_month == 'CALENDAR_PREFIX_MONTH_FACULTATIVE') { $prefix_month = ''; } // Suffix Month (Facultative) $suffix_month = JText::_('SUFFIX_MONTH'); if ($suffix_month == 'CALENDAR_SUFFIX_MONTH_FACULTATIVE') { $suffix_month = ''; } // Prefix Year (Facultative) $prefix_year = JText::_('PREFIX_YEAR'); if ($prefix_year == 'CALENDAR_PREFIX_YEAR_FACULTATIVE') { $prefix_year = ''; } // Suffix Year (Facultative) $suffix_year = JText::_('SUFFIX_YEAR'); if ($suffix_year == 'CALENDAR_SUFFIX_YEAR_FACULTATIVE') { $suffix_year = ''; } $SEP = $separator_month_year; $PM = $prefix_month; $SM = $suffix_month; $PY = $prefix_year; $SY = $suffix_year; // Get MONTH_CAL string or if not translated, use MONTHS $array_months = array('JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY', 'AUGUST', 'SEPTEMBER', 'OCTOBER', 'NOVEMBER', 'DECEMBER'); $cal_string = $t_month . '_CAL'; $missing_cal_string = iCFilterOutput::stringToJText($cal_string); if (in_array($missing_cal_string, $array_months)) { // if MONTHS_CAL strings not translated in current language, use MONTHS strings $month_J = JText::_($t_month); } else { // Use MONTHS_CAL strings when translated in current language $month_J = JText::_($t_month . '_CAL'); } // Set Calendar Title if ($monthBeforeYear == 0) { $title = $PY . $t_year . $SY . $SEP . $PM . $month_J . $SM; } else { $title = $PM . $month_J . $SM . $SEP . $PY . $t_year . $SY; } // Set Nav Bar for calendar $html = '<div class="icnav">' . $backY . $back . $nextY . $next; $html .= '<div class="titleic">' . $title . '</div>'; $html .= '</div><div style="clear:both"></div>'; return $html; }
/** * Overloaded check function * @since 3.4.0 */ public function check() { // Import Joomla 2.5 jimport('joomla.filter.output'); // If there is an ordering column and this is a new row then get the next ordering value if (property_exists($this, 'ordering') && $this->id == 0) { $this->ordering = self::getNextOrder(); } // URL alias if (empty($this->alias)) { $this->alias = $this->title; } $this->alias = JFilterOutput::stringURLSafe($this->alias); // Alias is not generated if non-latin characters, so we fix it by using created date, or title if unicode is activated, as alias if ($this->alias == null || empty($this->alias)) { if (JFactory::getConfig()->get('unicodeslugs') == 1) { $this->alias = JFilterOutput::stringURLUnicodeSlug($this->title); } else { $this->alias = JFilterOutput::stringURLSafe($this->created); } } // Slug auto-create $slug_empty = empty($this->slug) ? true : false; if ($slug_empty) { $this->slug = $this->title; } $this->slug = iCFilterOutput::stringToSlug($this->slug); // Slug is not generated if non-latin characters, so we fix it by using created date as a slug if ($this->slug == null) { $this->slug = iCFilterOutput::stringToSlug($this->created); } // Check if Slug already exists $db = JFactory::getDbo(); $query = $db->getQuery(true)->select('slug')->from($db->qn('#__icagenda_customfields'))->where($db->qn('slug') . ' = ' . $db->q($this->slug)); if (!empty($this->id)) { $query->where('id <> ' . (int) $this->id); } $db->setQuery($query); $slug_exists = $db->loadResult(); if ($slug_exists) { $error_slug = $slug_empty ? JText::sprintf('COM_ICAGENDA_CUSTOMFIELD_DATABASE_ERROR_AUTO_SLUG', '<strong>' . $this->title . '</strong>', '<strong>' . $this->slug . '</strong>') : '<strong>' . JText::_('COM_ICAGENDA_CUSTOMFIELD_DATABASE_ERROR_UNIQUE_SLUG') . '</strong>'; $this->setError($error_slug . '<br /><br /><span class="iCicon-info-circle"></span> <i>' . JTEXT::_('COM_ICAGENDA_CUSTOMFIELD_SLUG_DESC') . '</i>'); return false; } return parent::check(); }