public function getFileColumnValue() { $file = $this->getFile(); $dirName = dirname($file); $fileName = basename($file); $cropedFile = KT::stringCrop($file, 30, false); return "<span title=\"{$dirName} - {$fileName}\" class=\"kt-tooltip\">{$cropedFile}</span>"; }
/** * Vrátí odkazy předchozího a následujícího článku, pokud jsou k dispozici * * @author Martin Hlaváč * @link http://www.ktstudio.cz * * @param string $class * @param string $maxLength * @param string $separator * @param string $taxonomy * @param boolean $inSameTerm * @param string $excludedTerms * @return string */ public static function getPreviousNextPostLinks($class = null, $maxLength = 30, $separator = " | ", $taxonomy = KT_WP_CATEGORY_KEY, $inSameTerm = false, $excludedTerms = "") { $links = array(); $previousPost = get_previous_post($inSameTerm, $excludedTerms, $taxonomy); if (KT::issetAndNotEmpty($previousPost)) { $previousUrl = get_permalink($previousPost); $previousTitle = KT::stringCrop($previousPost->post_title, $maxLength); array_push($links, "<a href=\"{$previousUrl}\" title=\"{$previousPost->post_title}\" class=\"prev {$class}\">{$previousTitle}</a>"); } $nextPost = get_next_post($inSameTerm, $excludedTerms, $taxonomy); if (KT::issetAndNotEmpty($nextPost)) { $nextUrl = get_permalink($nextPost); $nextTitle = KT::stringCrop($nextPost->post_title, $maxLength); array_push($links, "<a href=\"{$nextUrl}\" title=\"{$nextPost->post_title}\" class=\"next {$class}\">{$nextTitle}</a>"); } if (KT::arrayIssetAndNotEmpty($links)) { return implode($separator, $links); } return null; }