本文整理汇总了PHP中ilYuiUtil::initColorPicker方法的典型用法代码示例。如果您正苦于以下问题:PHP ilYuiUtil::initColorPicker方法的具体用法?PHP ilYuiUtil::initColorPicker怎么用?PHP ilYuiUtil::initColorPicker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilYuiUtil
的用法示例。
在下文中一共展示了ilYuiUtil::initColorPicker方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insert
/**
* Insert property html
*
* @return int Size
*/
function insert($a_tpl)
{
global $tpl;
include_once './Services/YUI/classes/class.ilYuiUtil.php';
ilYuiUtil::initColorPicker();
$a_tpl->setCurrentBlock("prop_color");
$js_tpl = new ilTemplate('tpl.color_picker.js', true, true, 'Services/Form');
$js_tpl->setVariable('THUMB_PATH', ilUtil::getImagePath('color_picker_thumb.png', 'Services/Form'));
$js_tpl->setVariable('HUE_THUMB_PATH', ilUtil::getImagePath('color_picker_hue_thumb.png', 'Services/Form'));
$js_tpl->setVariable('COLOR_ID', $this->getFieldId());
$ic = ilColorPickerInputGUI::determineHexcode($this->getHexcode());
if ($ic == "") {
$ic = "FFFFFF";
}
$js_tpl->setVariable('INIT_COLOR_SHORT', $ic);
$js_tpl->setVariable('INIT_COLOR', '#' . $this->getHexcode());
$js_tpl->setVariable('POST_VAR', $this->getPostVar());
if ($this->getDisabled()) {
$a_tpl->setVariable('COLOR_DISABLED', 'disabled="disabled"');
} else {
$a_tpl->setVariable('PROP_COLOR_JS', $js_tpl->get());
}
$a_tpl->setVariable("POST_VAR", $this->getPostVar());
$a_tpl->setVariable("PROP_COLOR_ID", $this->getFieldId());
if (substr(trim($this->getValue()), 0, 1) == "!" && $this->getAcceptNamedColors()) {
$a_tpl->setVariable("PROPERTY_VALUE_COLOR", ilUtil::prepareFormOutput(trim($this->getValue())));
} else {
$a_tpl->setVariable("PROPERTY_VALUE_COLOR", ilUtil::prepareFormOutput($this->getHexcode()));
}
$a_tpl->parseCurrentBlock();
}
示例2: insert
/**
* Insert property html
*
* @return int Size
*/
function insert($a_tpl)
{
global $lng;
include_once './Services/YUI/classes/class.ilYuiUtil.php';
ilYuiUtil::initColorPicker();
$layout_tpl = new ilTemplate("tpl.prop_trbl_layout.html", true, true, "Services/Style");
$funcs = array("all" => "getAllValue", "top" => "getTopValue", "bottom" => "getBottomValue", "left" => "getLeftValue", "right" => "getRightValue");
foreach ($this->dirs as $dir) {
/*switch($dir)
{
case "all": $value = strtoupper(trim($this->getAllValue())); break;
case "top": $value = strtoupper(trim($this->getTopValue())); break;
case "bottom": $value = strtoupper(trim($this->getBottomValue())); break;
case "left": $value = strtoupper(trim($this->getLeftValue())); break;
case "right": $value = strtoupper(trim($this->getRightValue())); break;
}*/
$value = trim($this->{$funcs}[$dir]());
if (!$this->getAcceptNamedColors() || substr($value, 0, 1) != "!") {
$value = strtoupper($value);
}
$ctpl = new ilTemplate("tpl.prop_trbl_color.html", true, true, "Services/Style");
$js_tpl = new ilTemplate('tpl.trbl_color_picker.js', true, true, 'Services/Style');
$js_tpl->setVariable('THUMB_PATH', ilUtil::getImagePath('color_picker_thumb.png', 'Services/Form'));
$js_tpl->setVariable('HUE_THUMB_PATH', ilUtil::getImagePath('color_picker_hue_thumb.png', 'Services/Form'));
$js_tpl->setVariable('COLOR_ID', $this->getFieldId() . "_" . $dir);
$ic = ilColorPickerInputGUI::determineHexcode($value);
if ($ic == "") {
$ic = "FFFFFF";
}
$js_tpl->setVariable('INIT_COLOR_SHORT', $ic);
$js_tpl->setVariable('INIT_COLOR', '#' . $value);
$js_tpl->setVariable('POST_VAR', $this->getPostVar());
$js_tpl->setVariable('DIR', $dir);
if ($this->getDisabled()) {
$ctpl->setVariable('COLOR_DISABLED', 'disabled="disabled"');
} else {
$ctpl->setVariable('PROP_COLOR_JS', $js_tpl->get());
}
$ctpl->setVariable("POST_VAR", $this->getPostVar());
$ctpl->setVariable("PROP_COLOR_ID", $this->getFieldId() . "_" . $dir);
$ctpl->setVariable("PROPERTY_VALUE_COLOR", $value);
$ctpl->setVariable("DIR", $dir);
$ctpl->setVariable("TXT_DIR", $lng->txt("sty_{$dir}"));
$layout_tpl->setVariable(strtoupper($dir), $ctpl->get());
}
$a_tpl->setCurrentBlock("prop_generic");
$a_tpl->setVariable("PROP_GENERIC", $layout_tpl->get());
$a_tpl->parseCurrentBlock();
}