pool/web/yaamp/ui/lib/libview.php
Tanguy Pruvot bb31cec957 dos2unix all files, we are on linux
trim them, btw... its important to start on a clean base...
2015-07-12 04:40:50 +02:00

59 lines
1.1 KiB
PHP

<?php
function showButtonHeader()
{
echo "<div class='buttonwrapper'>";
}
function showButton($name, $link, $htmlOptions = array())
{
echo CHtml::link($name, $link, $htmlOptions);
}
function showButtonPost($name, $htmlOptions)
{
echo CHtml::linkButton($name, $htmlOptions);
}
function showTextTeaser($text, $more, $count = 120, $class = 'text')
{
if(empty($text)) return "";
$text = strip_tags($text);
if(strlen($text) < $count)
{
echo "<p class='$class'>$text</p>";
return;
}
$text = substr($text, 0, $count)."...";
echo "<p class='$class'>".$text." [".CHtml::link("more...", $more)."]</p>";
}
function getTextTeaser($text, $count = 120)
{
if(empty($text)) return "";
$text = strip_tags($text);
if(strlen($text) < $count)
return $text;
$text = substr($text, 0, $count)."...";
return $text;
}
function getTextTitle($text)
{
$b = preg_match('/([^\.\r\n]*)/', $text, $match);
return $match[1];
}
function showTableSorter($id, $options='')
{
JavascriptReady("$('#{$id}').tablesorter({$options});");
echo "<table id='$id' class='dataGrid2'>";
}