当前位置: 首页>>代码示例>>PHP>>正文


PHP XoopsLocale::getFonts方法代码示例

本文整理汇总了PHP中XoopsLocale::getFonts方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsLocale::getFonts方法的具体用法?PHP XoopsLocale::getFonts怎么用?PHP XoopsLocale::getFonts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XoopsLocale的用法示例。


在下文中一共展示了XoopsLocale::getFonts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fontArray

 /**
  * fontArray
  *
  * @return string
  */
 public function fontArray()
 {
     $textarea_id = $this->getName();
     $hiddentext = $this->hiddenText;
     $fontStr = "<script type=\"text/javascript\" language=\"JavaScript\">";
     $fontStr .= "var _editor_dialog = ''" . "+ '<select class=\"span2\" id=\\'{$textarea_id}Size\\' onchange=\\'xoopsSetElementAttribute(\"size\", this.options[this.selectedIndex].value, \"{$textarea_id}\", \"{$hiddentext}\");\\'>'";
     $fontStr .= "+ '<option value=\\'SIZE\\'>" . \XoopsLocale::SIZE . "</option>'";
     $localeFontSizes = \XoopsLocale::getFontSizes();
     foreach ($localeFontSizes as $_val => $_name) {
         $fontStr .= " + '<option value=\\'{$_val}\\'>{$_name}</option>'";
     }
     $fontStr .= " + '</select> '";
     $fontStr .= "+ '<select class=\"span2\" id=\\'{$textarea_id}Font\\' onchange=\\'xoopsSetElementAttribute(\"font\", this.options[this.selectedIndex].value, \"{$textarea_id}\", \"{$hiddentext}\");\\'>'";
     $fontStr .= "+ '<option value=\\'FONT\\'>" . \XoopsLocale::FONT . "</option>'";
     $localeFonts = \XoopsLocale::getFonts();
     $fontarray = !empty($localeFonts) ? $localeFonts : array("Arial", "Courier", "Georgia", "Helvetica", "Impact", "Verdana", "Haettenschweiler");
     foreach ($fontarray as $font) {
         $fontStr .= " + '<option value=\\'{$font}\\'>{$font}</option>'";
     }
     $fontStr .= " + '</select> '";
     $fontStr .= "+ '<select class=\"span2\" id=\\'{$textarea_id}Color\\' onchange=\\'xoopsSetElementAttribute(\"color\", this.options[this.selectedIndex].value, \"{$textarea_id}\", \"{$hiddentext}\");\\'>'";
     $fontStr .= "+ '<option value=\\'COLOR\\'>" . \XoopsLocale::COLOR . "</option>';";
     $fontStr .= "var _color_array = new Array('00', '33', '66', '99', 'CC', 'FF');\n            for(var i = 0; i < _color_array.length; i ++) {\n                for(var j = 0; j < _color_array.length; j ++) {\n                    for(var k = 0; k < _color_array.length; k ++) {\n                        var _color_ele = _color_array[i] + _color_array[j] + _color_array[k];\n                        _editor_dialog += '<option value=\\''+_color_ele+'\\' style=\\'background-color:#'+_color_ele+';color:#'+_color_ele+';\\'>#'+_color_ele+'</option>';\n                    }\n                }\n            }\n            _editor_dialog += '</select>';";
     $fontStr .= "document.write(_editor_dialog); </script>";
     $styleStr = "<img src='" . \XoopsBaseConfig::get('url') . "/images/bold.gif' alt='" . \XoopsLocale::BOLD . "' title='" . \XoopsLocale::BOLD . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeBold(\"{$hiddentext}\", \"{$textarea_id}\");' />&nbsp;";
     $styleStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/italic.gif' alt='" . \XoopsLocale::ITALIC . "' title='" . \XoopsLocale::ITALIC . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeItalic(\"{$hiddentext}\", \"{$textarea_id}\");' />&nbsp;";
     $styleStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/underline.gif' alt='" . \XoopsLocale::UNDERLINE . "' title='" . \XoopsLocale::UNDERLINE . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeUnderline(\"{$hiddentext}\", \"{$textarea_id}\");'/>&nbsp;";
     $styleStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/linethrough.gif' alt='" . \XoopsLocale::LINE_THROUGH . "' title='" . \XoopsLocale::LINE_THROUGH . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeLineThrough(\"{$hiddentext}\", \"{$textarea_id}\");' />&nbsp;";
     $alignStr = "<img src='" . \XoopsBaseConfig::get('url') . "/images/alignleft.gif' alt='" . \XoopsLocale::LEFT . "' title='" . \XoopsLocale::LEFT . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeLeft(\"{$hiddentext}\", \"{$textarea_id}\");' />&nbsp;";
     $alignStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/aligncenter.gif' alt='" . \XoopsLocale::CENTER . "' title='" . \XoopsLocale::CENTER . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeCenter(\"{$hiddentext}\", \"{$textarea_id}\");' />&nbsp;";
     $alignStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/alignright.gif' alt='" . \XoopsLocale::RIGHT . "' title='" . \XoopsLocale::RIGHT . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeRight(\"{$hiddentext}\", \"{$textarea_id}\");' />&nbsp;";
     $fontStr = $fontStr . "<br />\n{$styleStr}&nbsp;{$alignStr}&nbsp;\n";
     return $fontStr;
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:39,代码来源:DhtmlTextArea.php


注:本文中的XoopsLocale::getFonts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。