本文整理汇总了PHP中cms_utils::get_syntax_highlighter_module方法的典型用法代码示例。如果您正苦于以下问题:PHP cms_utils::get_syntax_highlighter_module方法的具体用法?PHP cms_utils::get_syntax_highlighter_module怎么用?PHP cms_utils::get_syntax_highlighter_module使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cms_utils
的用法示例。
在下文中一共展示了cms_utils::get_syntax_highlighter_module方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: jQuery
$template = $onetemplate->name;
$orig_template = $onetemplate->name;
$content = $onetemplate->content;
$stylesheet = $onetemplate->stylesheet;
$encoding = $onetemplate->encoding;
$default = $onetemplate->default;
$active = $onetemplate->active;
$lastedited = $onetemplate->modified_date;
}
}
}
if (strlen($template) > 0) {
$CMS_ADMIN_SUBTITLE = $template;
}
$addlScriptSubmit = '';
$modobj = cms_utils::get_syntax_highlighter_module();
if (is_object($modobj)) {
$addlScriptSubmit = $modobj->SyntaxPageFormSubmit();
}
$closestr = cms_html_entity_decode(lang('close'));
$headtext = <<<EOSCRIPT
<script type="text/javascript">
// <![CDATA[
jQuery(document).ready(function(){
jQuery('[name=apply]').live('click',function(){
var data = jQuery('#Edit_Template').find('input:not([type=submit]), select, textarea').serializeArray();
data.push({ 'name': 'ajax', 'value': 1});
data.push({ 'name': 'apply', 'value': 1 });
\$.post('{$_SERVER['REQUEST_URI']}',data,function(resultdata,text){
var event = jQuery.Event('cms_ajax_apply');
event.response = \$(resultdata).find('Response').text();
示例2: 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;
}