コード例 #1
0
ファイル: AbstractTret.php プロジェクト: kix/mdash
 /**
  * Создание защищенного тега с содержимым
  *
  * @see    EMT_lib::build_safe_tag
  * @param  string $content
  * @param  string $tag
  * @param  array $attribute
  * @return string
  */
 protected function tag($content, $tag = 'span', $attribute = array())
 {
     if (isset($attribute['class'])) {
         $classname = $attribute['class'];
         if ($classname == "nowrap") {
             if (!$this->is_on('nowrap')) {
                 $tag = "nobr";
                 $attribute = array();
                 $classname = "";
             }
         }
         if (isset($this->classes[$classname])) {
             $style_inline = $this->classes[$classname];
             if ($style_inline) {
                 $attribute['__style'] = $style_inline;
             }
         }
         $classname = isset($this->class_names[$classname]) ? $this->class_names[$classname] : $classname;
         $classname = ($this->class_layout_prefix ? $this->class_layout_prefix : "") . $classname;
         $attribute['class'] = $classname;
     }
     return Util::build_safe_tag($content, $tag, $attribute, $this->use_layout === false ? Util::LAYOUT_STYLE : $this->use_layout);
 }