Example #1
0
 /**
  * 标题输入框,含有标题样式
  *
  * @param $attrs array 控件参数
  * @return string 控件代码
  */
 public static function title($attrs)
 {
     $style = arr::decode($attrs['style'], ';', ':');
     $html[] = html::script('$common/js/jquery.colorpicker.js');
     $html[] = html::script('$common/js/zotop.title.js');
     $html[] = '<div class="field-wrapper clearfix">';
     $html[] = '	' . field::text($attrs);
     $html[] = '	' . field::hidden(array('name' => $attrs['name'] . '_color', 'id' => $attrs['name'] . '_style', 'class' => 'short', 'value' => $style['color']));
     $html[] = '	' . field::hidden(array('name' => $attrs['name'] . '_weight', 'id' => $attrs['name'] . '_weight', 'class' => 'short', 'value' => $style['font-weight']));
     $html[] = '	<span class="field-handle">';
     $html[] = '		<a class="setweight" style="display:inline-block;" valueto="' . $attrs['name'] . '_weight" weightto="' . $attrs['name'] . '" title="' . zotop::t('加粗') . '"><span class="zotop-icon zotop-icon-b"></span></a>';
     $html[] = '		<a class="setcolor" style="display:inline-block;" valueto="' . $attrs['name'] . '_color" colorto="' . $attrs['name'] . '" title="' . zotop::t('色彩') . '"><span class="zotop-icon zotop-icon-setcolor ' . $style['font-weight'] . '"></span></a>';
     $html[] = '	</span>';
     $html[] = '</div>';
     return implode("\n", $html);
 }