Active Calls: Update refresh/pause button.

This commit is contained in:
Nate
2019-10-30 01:05:43 -06:00
parent bc3f71b911
commit 7b1356310b
4 changed files with 33 additions and 15 deletions

View File

@@ -35,18 +35,20 @@ if (!class_exists('button')) {
//button: open
$button = "<button ";
$button .= "type='".($array['type'] ? $array['type'] : 'button')."' ";
$button .= $array['name'] ? "name=\"".$array['name']."\" " : null;
$button .= $array['value'] ? "value=\"".$array['value']."\" " : null;
$button .= $array['id'] ? "id=\"".$array['id']."\" " : null;
$button .= $array['label'] ? "alt=\"".$array['label']."\" " : ($array['title'] ? "alt=\"".$array['title']."\" " : null);
$button .= $array['name'] ? "name=".self::quote($array['name'])." " : null;
$button .= $array['value'] ? "value=".self::quote($array['value'])." " : null;
$button .= $array['id'] ? "id='".$array['id']."' " : null;
$button .= $array['label'] ? "alt=".self::quote($array['label'])." " : ($array['title'] ? "alt=".self::quote($array['title'])." " : null);
if ($button_icons == 'only' || $button_icons == 'auto' || $array['title']) {
$button .= "title=\"".($array['title'] ? $array['title'] : $array['label'])."\" ";
if ($array['title'] || $array['label']) {
$button .= "title=".($array['title'] ? self::quote($array['title']) : self::quote($array['label']))." ";
}
}
$button .= $array['onclick'] ? "onclick=\"".$array['onclick']."\" " : null;
$button .= $array['onmouseover'] ? "onmouseenter=\"".$array['onmouseover']."\" " : null;
$button .= $array['onmouseout'] ? "onmouseleave=\"".$array['onmouseout']."\" " : null;
$button .= $array['onclick'] ? "onclick=".self::quote($array['onclick'])." " : null;
$button .= $array['onmouseover'] ? "onmouseenter=".self::quote($array['onmouseover'])." " : null;
$button .= $array['onmouseout'] ? "onmouseleave=".self::quote($array['onmouseout'])." " : null;
$button .= "class='btn btn-".($array['class'] ? $array['class'] : 'default')." ".($array['disabled'] ? 'disabled' : null)."' ";
$button .= "style='margin-left: 2px; margin-right: 2px; ".($array['style'] ? $array['style'] : null)."' ";
$button .= $array['style'] ? "style=".self::quote($array['style'])." " : null;
$button .= $array['disabled'] ? "disabled='disabled' " : null;
$button .= ">";
//icon
@@ -82,8 +84,8 @@ if (!class_exists('button')) {
if ($array['link']) {
$anchor = "<a ";
$anchor .= "href='".$array['link']."' ";
$anchor .= "target=\"".($array['target'] ? $array['target'] : '_self')."\" ";
$anchor .= ($array['disabled'] ? "class='disabled' onclick='return false;'" : null)." ";
$anchor .= "target='".($array['target'] ? $array['target'] : '_self')."' ";
$anchor .= $array['disabled'] ? "class='disabled' onclick='return false;' " : null;
$anchor .= ">";
$button = $anchor.$button."</a>";
}
@@ -91,6 +93,10 @@ if (!class_exists('button')) {
unset($button);
}
private static function quote($value) {
return substr_count($value, "'") ? '"'.$value.'"' : "'".$value."'";
}
}
}