$title\n";
}
/**
* Create a meta.
*
* @param mixed $name the meta name
* @param mixed $value the meta value
* @access public
* @return string
*/
public static function meta($name, $value)
{
return "\n";
}
/**
* Create fav icon tag
*
* @param mixed $url the url of the icon.
* @access public
* @return string
*/
public static function favicon($url)
{
return "\n" .
"\n";
}
/**
* Create icon tag
*
* @param name $name the name of the icon.
* @param cssClass $class the extra css class of the icon.
* @access public
* @return string
*/
public static function icon($name, $class = '')
{
$class = empty($class) ? ('icon-' . $name) : ('icon-' . $name . ' ' . $class);
return "";
}
/**
* Create the rss tag.
*
* @param string $url
* @param string $title
* @static
* @access public
* @return string
*/
public static function rss($url, $title = '')
{
return "";
}
/**
* Create tags like text
*
* @param string $href the link url.
* @param string $title the link title.
* @param string $target the target window
* @param string $misc other params.
* @param boolean $newline
* @return string
*/
static public function a($href = '', $title = '', $target = "_self", $misc = '', $newline = true)
{
global $config;
if(empty($title)) $title = $href;
$newline = $newline ? "\n" : '';
/* if page has onlybody param then add this param in all link. the param hide header and footer. */
if(strpos($href, 'onlybody=yes') === false and isonlybody())
{
$onlybody = $config->requestType == 'PATH_INFO' ? "?onlybody=yes" : "&onlybody=yes";
$href .= $onlybody;
}
if($target == '_self') return "$title$newline";
return "$title$newline";
}
/**
* Create tags like text
*
* @param string $mail the email address
* @param string $title the email title.
* @return string
*/
static public function mailto($mail = '', $title = '')
{
if(empty($title)) $title = $mail;
return "$title";
}
/**
* Create tags like ""
*
* @param string $name the name of the select tag.
* @param array $options the array to create select tag from.
* @param string $selectedItems the item(s) to be selected, can like item1,item2.
* @param string $attrib other params such as multiple, size and style.
* @param string $append adjust if add options[$selectedItems].
* @return string
*/
static public function select($name = '', $options = array(), $selectedItems = "", $attrib = "", $append = false)
{
$options = (array)($options);
if($append and !isset($options[$selectedItems])) $options[$selectedItems] = $selectedItems;
if(!is_array($options) or empty($options)) return false;
/* The begin. */
$id = $name;
if(strpos($name, '[') !== false) $id = trim(str_replace(']', '', str_replace('[', '', $name)));
$string = "\n";
}
/**
* Create select with optgroup.
*
* @param string $name the name of the select tag.
* @param array $groups the option groups.
* @param string $selectedItems the item(s) to be selected, can like item1,item2.
* @param string $attrib other params such as multiple, size and style.
* @return string
*/
static public function selectGroup($name = '', $groups = array(), $selectedItems = "", $attrib = "")
{
if(!is_array($groups) or empty($groups)) return false;
/* The begin. */
$id = $name;
if(strpos($name, '[') !== false) $id = trim(str_replace(']', '', str_replace('[', '', $name)));
$string = "\n";
}
/**
* Create tags like ""
*
* @param string $name the name of the radio tag.
* @param array $options the array to create radio tag from.
* @param string $checked the value to checked by default.
* @param string $attrib other attribs.
* @param string $type inline or block
* @return string
*/
static public function radio($name = '', $options = array(), $checked = '', $attrib = '', $type = 'inline')
{
$options = (array)($options);
if(!is_array($options) or empty($options)) return false;
$isBlock = $type == 'block';
$string = '';
foreach($options as $key => $value)
{
if($isBlock) $string .= "