本文整理汇总了PHP中XoopsLocale::getFontSizes方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsLocale::getFontSizes方法的具体用法?PHP XoopsLocale::getFontSizes怎么用?PHP XoopsLocale::getFontSizes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsLocale
的用法示例。
在下文中一共展示了XoopsLocale::getFontSizes方法的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}\");' /> ";
$styleStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/italic.gif' alt='" . \XoopsLocale::ITALIC . "' title='" . \XoopsLocale::ITALIC . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeItalic(\"{$hiddentext}\", \"{$textarea_id}\");' /> ";
$styleStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/underline.gif' alt='" . \XoopsLocale::UNDERLINE . "' title='" . \XoopsLocale::UNDERLINE . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeUnderline(\"{$hiddentext}\", \"{$textarea_id}\");'/> ";
$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}\");' /> ";
$alignStr = "<img src='" . \XoopsBaseConfig::get('url') . "/images/alignleft.gif' alt='" . \XoopsLocale::LEFT . "' title='" . \XoopsLocale::LEFT . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeLeft(\"{$hiddentext}\", \"{$textarea_id}\");' /> ";
$alignStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/aligncenter.gif' alt='" . \XoopsLocale::CENTER . "' title='" . \XoopsLocale::CENTER . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeCenter(\"{$hiddentext}\", \"{$textarea_id}\");' /> ";
$alignStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/alignright.gif' alt='" . \XoopsLocale::RIGHT . "' title='" . \XoopsLocale::RIGHT . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeRight(\"{$hiddentext}\", \"{$textarea_id}\");' /> ";
$fontStr = $fontStr . "<br />\n{$styleStr} {$alignStr} \n";
return $fontStr;
}