本文整理汇总了PHP中cms_utils::get_wysiwyg_module方法的典型用法代码示例。如果您正苦于以下问题:PHP cms_utils::get_wysiwyg_module方法的具体用法?PHP cms_utils::get_wysiwyg_module怎么用?PHP cms_utils::get_wysiwyg_module使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cms_utils
的用法示例。
在下文中一共展示了cms_utils::get_wysiwyg_module方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create_textarea
/**
* A method to create a text area control
*
* @internal
* @access private
* @param boolean Wether the currently selected wysiwyg area should be enabled (depends on user, and site preferences
* @param string The contents of the text area
* @param string The name of the text area
* @param string An optional class name
* @param string An optional ID (HTML ID) value
* @param string The optional encoding
* @param string Optional style information
* @param integer Width (the number of columns) (CSS can and will override this)
* @param integer Hieght (the number of rows) (CSS can and will override this)
* @param string A flag to indicate that the wysiwyg should be forced to a different type independant of user settings
* @param string The name of the syntax hilighter to use (if empty it is assumed that a wysiwyg text area is requested instead of a syntax hiliter)
* @param string Optional additional text to include in the textarea tag
* @return string
*/
function create_textarea($enablewysiwyg, $text, $name, $classname = '', $id = '', $encoding = '', $stylesheet = '', $width = '80', $height = '15', $forcewysiwyg = '', $wantedsyntax = '', $addtext = '')
{
$gCms = cmsms();
$result = '';
$uid = get_userid(false);
if ($enablewysiwyg == true) {
$module = cms_utils::get_wysiwyg_module($forcewysiwyg);
if ($module) {
$result = $module->WYSIWYGTextArea($name, $width, $height, $encoding, $text, $stylesheet, $addtext);
}
}
if (!$result && $wantedsyntax) {
$module = cms_utils::get_syntax_highlighter_module();
if ($module) {
$result = $module->SyntaxTextArea($name, $wantedsyntax, $width, $height, $encoding, $text, $addtext);
}
}
if ($result == '') {
$result = '<textarea name="' . $name . '" cols="' . $width . '" rows="' . $height . '"';
if ($classname != '') {
$result .= ' class="' . $classname . '"';
} else {
$result .= ' class="cms_textarea"';
}
if ($id != '') {
$result .= ' id="' . $id . '"';
}
if (!empty($addtext)) {
$result .= ' ' . $addtext;
}
$result .= '>' . cms_htmlentities($text, ENT_NOQUOTES, get_encoding($encoding)) . '</textarea>';
}
return $result;
}
示例2: lang
print ']]></Details>';
} else {
print '<Response>Success</Response>';
print '<Details><![CDATA[' . lang('contentupdated') . ']]></Details>';
}
print '</EditContent>';
exit;
}
}
}
if (strlen($contentobj->Name()) > 0) {
$CMS_ADMIN_SUBTITLE = $contentobj->Name();
}
// Detect if a WYSIWYG is in use, and grab its form submit action
$addlScriptSubmit = '';
$modobj = cms_utils::get_wysiwyg_module();
if ($modobj) {
$addlScriptSubmit .= $modobj->WYSIWYGPageFormSubmit();
}
$closestr = cms_html_entity_decode(lang('close'));
$cancelstr = cms_html_entity_decode(lang('confirmcancel'));
$headtext .= <<<EOSCRIPT
<script type="text/javascript">
// <![CDATA[
jQuery(document).ready(function(){
jQuery('[name=cancel]').click(function(){
var tmp = jQuery(this).val();
if( tmp == '{$closestr}' )
{
\treturn true;
}
示例3: create_textarea
/**
* A method to create a text area control
*
* @internal
* @access private
* @param boolean Wether or not we are enabling a wysiwyg. If false, and forcewysiwyg is not empty then a syntax area is used.
* @param string The contents of the text area
* @param string The name of the text area
* @param string An optional class name
* @param string An optional ID (HTML ID) value
* @param string The optional encoding
* @param string Optional style information
* @param integer Width (the number of columns) (CSS can and will override this)
* @param integer Hieght (the number of rows) (CSS can and will override this)
* @param string Optional name of the syntax hilighter or wysiwyg to use. If empty, preferences indicate which a syntax editor or wysiwyg should be used.
* @param string Optional name of the language used. If non empty it indicates that a syntax highlihter will be used.
* @param string Optional additional text to include in the textarea tag
* @return string
*/
function create_textarea($enablewysiwyg, $text, $name, $classname = '', $id = '', $encoding = '', $stylesheet = '', $width = '80', $height = '15', $forcewysiwyg = '', $wantedsyntax = '', $addtext = '')
{
// todo: rewrite me with var args... to accept a numeric array of arguments, or a hash.
$gCms = cmsms();
$result = '';
$uid = get_userid(false);
if ($enablewysiwyg == true || $forcewysiwyg) {
$module = cms_utils::get_wysiwyg_module($forcewysiwyg);
if ($module) {
$result = $module->WYSIWYGTextArea($name, $width, $height, $encoding, $text, $stylesheet, $addtext);
}
}
if (!$result && $wantedsyntax) {
// here we should get a list of installed/available modules.
$module = cmsms()->GetModuleOperations()->GetSyntaxHighlighter($forcewysiwyg);
if ($module) {
$result = $module->SyntaxTextArea($name, $wantedsyntax, $width, $height, $encoding, $text, $addtext);
}
}
if ($result == '') {
$result = '<textarea name="' . $name . '" cols="' . $width . '" rows="' . $height . '"';
if ($classname != '') {
$result .= ' class="' . $classname . '"';
} else {
$result .= ' class="cms_textarea"';
}
if ($id != '') {
$result .= ' id="' . $id . '"';
}
if (!empty($addtext)) {
$result .= ' ' . $addtext;
}
$result .= '>' . cms_htmlentities($text, ENT_NOQUOTES, get_encoding($encoding)) . '</textarea>';
}
return $result;
}