本文整理汇总了PHP中JEditor类的典型用法代码示例。如果您正苦于以下问题:PHP JEditor类的具体用法?PHP JEditor怎么用?PHP JEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JEditor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Display method
*
* @param string $tpl The template name
*
* @return void
*/
public function display($tpl = null)
{
$this->form = $this->get('Form');
$this->translationTable = RedcoreHelpersTranslation::getTranslationTable();
$this->contentElement = RTranslationHelper::getContentElement($this->translationTable->option, $this->translationTable->xml);
$this->item = $this->get('Item');
$editor = JFactory::getConfig()->get('editor');
$this->editor = JEditor::getInstance($editor);
$this->columns = array();
$this->noTranslationColumns = array();
$tableColumns = (array) $this->translationTable->columns;
$this->fieldsXml = $this->contentElement->getTranslateFields();
foreach ($this->fieldsXml as $field) {
foreach ($tableColumns as $column) {
if ($column == (string) $field['name']) {
$attributes = current($field->attributes());
$attributes['titleLabel'] = (string) $field;
$this->columns[$column] = $attributes;
break;
}
}
if ((string) $field['translate'] == '0' && (string) $field['type'] != 'referenceid') {
$attributes = current($field->attributes());
$attributes['titleLabel'] = (string) $field;
$this->noTranslationColumns[(string) $field['name']] = $attributes;
}
}
// Check if option is enabled
if (RBootstrap::getConfig('enable_translations', 0) == 0) {
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_REDCORE_CONFIG_TRANSLATIONS_PLUGIN_LABEL_WARNING', '<a href="index.php?option=com_plugins&view=plugins&filter_search=redcore">' . JText::_('COM_REDCORE_CONFIGURE') . '</a>'), 'error');
}
parent::display($tpl);
}
开发者ID:thangredweb,项目名称:redCORE,代码行数:40,代码来源:view.html.php
示例2: display
/**
* @param string The control name
* @param string The contents of the text area
* @param string The width of the text area (px or %)
* @param string The height of the text area (px or %)
* @param boolean True and the editor buttons will be displayed
* @param array Associative array of editor parameters
* @return string
*/
public function display($name, $html, $width, $height, $buttons, $params)
{
if (SPRequest::cmd('format') != 'raw') {
// public function display($name, $html, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null, $params = array())
$editor = JEditor::getInstance(JFactory::getConfig()->get('editor'));
// JFactory::getEditor()->display( $name, $html, $width, $height, '75', '20', $buttons, $params );
return $editor->display($name, $html, $width, $height, 75, 20, $buttons, null, null, null, $params);
}
}
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:18,代码来源:editor.php
示例3: init
public function init()
{
if (is_a($this['system']->document, 'JDocumentRAW')) {
return;
}
$editor = JFactory::getConfig()->getValue('config.editor');
if (in_array(strtolower($editor), array('tinymce', 'jce'))) {
JEditor::getInstance($editor)->_loadEditor();
}
}
开发者ID:janssit,项目名称:www.coolensjuwelen.be,代码行数:10,代码来源:editor.php
示例4: display
function display($tpl = null)
{
global $mainframe, $option;
$db = JFactory::getDBO();
$uri = JFactory::getURI();
// Get data from the model
$lists = $this->_model->_lists;
$this->addToolbar($this->_model->_mode);
$editor = JEditor::getInstance();
$this->assignRef('editor', $editor);
$this->assignRef('lists', $lists);
require_once dirname(__FILE__) . '/tmpl/default' . ($tpl ? "_" . $tpl : "") . '.php';
}
开发者ID:greyhat777,项目名称:vuslinterliga,代码行数:13,代码来源:view.html.php
示例5: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*/
protected function getInput()
{
$editor = \JEditor::getInstance('codemirror');
$params['linenumbers'] = 1;
$params['tabmode'] = 'shift';
$params['width'] = 400;
$params['height'] = 300;
$doc = \JFactory::getDocument();
$doc->addStyleDeclaration(<<<CSS
.CodeMirror
{
\tw/idth: 700px;
\theight: 400px;
}
CSS
);
$output = $editor->display($this->name, $this->value, '400px', '400px', 400, 400, false, null, null, null, $params);
$output = "<fieldset class=\"adminform\"><div style=\"height: 400px; margin-bottom: 30px;\">{$output}</div></fieldset>";
return $output;
}
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:25,代码来源:codemirror.php
示例6: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*/
protected function getInput()
{
$plugin = JPluginHelper::isEnabled('system', 'ezset');
if (!$plugin) {
return print_r($plugin, 1) . '需要先啟動外掛!';
}
$this->loadScript();
$editor = \JEditor::getInstance('codemirror');
$client = \Windwalker\Helper\XmlHelper::get($this->element, 'client', 'site');
$content = $this->getContent($client);
$params['linenumbers'] = 1;
$params['tabmode'] = 'shift';
$params['width'] = 400;
$params['height'] = 300;
$params['syntax'] = 'css';
$doc = \JFactory::getDocument();
$doc->addStyleDeclaration(<<<CSS
.custom-css-field .CodeMirror
{
\tw/idth: 700px;
\theight: 400px;
}
CSS
);
$save = JText::_('PLG_SYSTEM_EZSET_SAVE');
$output = $editor->display($this->name, $content, '400px', '400px', 400, 400, false, null, null, null, $params);
$output = <<<HTML
<fieldset class="adminform custom-css-field">
\t<div style="margin-bottom: 25px;" class="custom-css-toolbar">
\t\t<button class="btn btn-default" type="button" data-client="{$client}"
\t\t\tonclick="EzsetCustomCSS.save('#{$this->id}', '{$this->name}', this, event);"><i class="icon-save"></i> {$save}</button>
\t</div>
\t<div style="height: 400px; margin-bottom: 30px;">{$output}</div>
</fieldset>
HTML;
return $output;
}
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:42,代码来源:customcss.php
示例7: _addJavascriptSumbit
/**
* Append JS code for form submit
*
* @param array &$script Scripts
* @param int $listId List id
* @param array $aWYSIWYGNames WYSIWYG editor names
*
* @since 3.1b
* @return void
*/
protected function _addJavascriptSumbit(&$script, $listId, $aWYSIWYGNames)
{
$script[] = "\tfunction submit_form() {";
if (!empty($aWYSIWYGNames)) {
jimport('joomla.html.editor');
$editor = JEditor::getInstance($this->config->get('editor'));
$script[] = $editor->save('label');
foreach ($aWYSIWYGNames as $parsedName) {
$script[] = $editor->save($parsedName);
}
}
$script[] = "\treturn false;";
$script[] = "}";
$script[] = "function submitbutton(button) {";
$script[] = "\tif (button==\"cancel\") {";
$script[] = "\t\tdocument.location = '" . JRoute::_('index.php?option=com_' . $this->package . '&task=viewTable&cid=' . $listId) . "';";
$script[] = "\t}";
$script[] = "\tif (button == \"cancelShowForm\") {";
$script[] = "\t\treturn false;";
$script[] = "\t}";
$script[] = "}";
}
开发者ID:LGBGit,项目名称:tierno,代码行数:32,代码来源:view.base.php
示例8: getEditor
/**
* Method to get a JEditor object based on the form field.
*
* @return JEditor The JEditor object.
*
* @since 1.6
*/
protected function getEditor()
{
// Only create the editor if it is not already created.
if (empty($this->editor)) {
$editor = null;
if ($this->editorType) {
// Get the list of editor types.
$types = $this->editorType;
// Get the database object.
$db = JFactory::getDbo();
// Iterate over teh types looking for an existing editor.
foreach ($types as $element) {
// Build the query.
$query = $db->getQuery(true)->select('element')->from('#__extensions')->where('element = ' . $db->quote($element))->where('folder = ' . $db->quote('editors'))->where('enabled = 1');
// Check of the editor exists.
$db->setQuery($query, 0, 1);
$editor = $db->loadResult();
// If an editor was found stop looking.
if ($editor) {
break;
}
}
}
// Create the JEditor instance based on the given editor.
if (is_null($editor)) {
$conf = JFactory::getConfig();
$editor = $conf->get('editor');
}
$this->editor = JEditor::getInstance($editor);
}
return $this->editor;
}
开发者ID:deenison,项目名称:joomla-cms,代码行数:39,代码来源:editor.php
示例9:
<input class="text_area" type="text" name="tx_id" id="tx_id" size="60" maxlength="255" value="<?php
echo $this->obj->tx_id;
?>
" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="notes"><?php
echo JText::_('COM_BOOKPRO_ORDER_NOTES');
?>
</label>
<div class="controls">
<?php
$editor = JEditor::getInstance();
echo $editor->display('notes', $this->obj->notes, '550', '200', '60', '20', false);
?>
</div>
</div>
</div>
<input type="hidden" name="option" value="<?php
echo OPTION;
?>
"/>
<input type="hidden" name="controller" value="<?php
echo CONTROLLER_ORDER;
?>
开发者ID:hixbotay,项目名称:executivetransport,代码行数:31,代码来源:form.php
示例10: prepareData
/**
* Prepare data hook.
*
* @return void
*/
protected function prepareData()
{
parent::prepareData();
// Load content language
$lang = JFactory::getLanguage();
$lang->load('com_content', JPATH_BASE, null, true, true);
$lang->load('com_menus', JPATH_BASE, null, true, true);
$data = $this->data;
$data->params = \Windwalker\System\ExtensionHelper::getParams('com_quickcontent');
$data->formParams = $this->get('FormParams');
$data->listParams = $this->buildParamsInput('list');
$data->blogParams = $this->buildParamsInput('blog');
$data->articleParams = $this->buildParamsInput('article');
// Set Editor
$editor = \JEditor::getInstance($data->params->get('editor', 'tinymce'));
$params['mode'] = 2;
$this->editor = $editor->display('jform[content]', $data->item->content, '650px', '500px', 650, 500, false, null, null, null, $params);
}
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:23,代码来源:html.php
示例11: getInput
/**
* Method to get the field input markup for Access Control Lists.
* Optionally can be associated with a specific component and section.
*
* @return string The field input markup.
*
* @since 11.1
* @todo: Add access check.
*/
protected function getInput()
{
JHtml::_('bootstrap.tooltip');
$conf = JFactory::getConfig();
$editor = $conf->get('editor');
$jeditor = JEditor::getInstance($editor);
// Get the available user groups.
$groups = $this->getEmailGroups();
// Prepare output
$html = array();
// Description
$html[] = '<p class="alert alert-info">' . JText::_('COM_DIGICOM_SETTINGS_SYSTEM_EMAIL_DESCRIPTION') . '</p>';
// Begin tabs
$html[] = '<div id="email_settings-sliders" class="tabbable tabs-left">';
// Building tab nav
$html[] = '<ul class="nav nav-pills">';
foreach ($groups as $group) {
// Initial Active Tab
$active = "";
if ($group->value == 'new_order') {
$active = "active";
}
$html[] = '<li class="' . $active . '">';
$html[] = '<a href="#email_setting-' . $group->value . '" data-toggle="tab">';
$html[] = $group->text;
$html[] = '</a>';
$html[] = '</li>';
}
$html[] = '</ul>';
$html[] = '<div class="tab-content">';
// Start a row for each user group.
foreach ($groups as $group) {
// Initial Active Pane
$active = "";
if ($group->value == 'new_order') {
$active = " active";
}
$html[] = '<div class="tab-pane' . $active . '" id="email_setting-' . $group->value . '">';
$html[] = '<h3>' . $group->desc . '</h3>';
//start control group
$html[] = '<div class="control-group ">';
$html[] = '<div class="control-label">';
$html[] = '<label id="jform_subject-lbl" for="jform_subject" title="' . JText::_('COM_DIGICOM_SETTINGS_SYSTEM_EMAIL_SUBJECT_LABEL_DESC') . '">';
$html[] = JText::_('COM_DIGICOM_SETTINGS_SYSTEM_EMAIL_SUBJECT_LABEL');
$html[] = '</label>';
$html[] = '</div>';
$html[] = '<div class="controls">';
$html[] = '<input type="text" class="input-xxlarge" value="' . $this->value[$group->value]['subject'] . '" name="' . $this->name . '[' . $group->value . '][subject]" size="60">';
$html[] = '</div>';
$html[] = '</div>';
//end control group
//start control group
$html[] = '<div class="control-group ">';
$html[] = '<div class="control-label">';
$html[] = '<label id="jform_body-lbl" for="jform_body" title="' . JText::_('COM_DIGICOM_SETTINGS_SYSTEM_EMAIL_BODY_LABEL_DESC') . '">';
$html[] = JText::_('COM_DIGICOM_SETTINGS_SYSTEM_EMAIL_BODY_LABEL');
$html[] = '</label>';
$html[] = '</div>';
$html[] = '<div class="controls">';
//$html[] = '<textarea name="'.$this->name.'['. $group->value .'][body]"></textarea>';
$bodyname = $this->name . '[' . $group->value . '][body]';
$bodyvalue = $this->value[$group->value]['body'];
$html[] = $this->getEditor($bodyname, $bodyvalue, $this->form);
$html[] = '</div>';
$html[] = '</div>';
//end control group
$html[] = '</div>';
}
$html[] = '</div>';
//end tab content
$html[] = '</div>';
//end tab
$html[] = '<div class="alert">';
$html[] = JText::_('COM_DIGICOM_SETTINGS_EMAIL_BOTTOM_NOTICE');
$html[] = '</div>';
return implode("\n", $html);
}
开发者ID:Shtier,项目名称:digicom,代码行数:86,代码来源:systememail.php
示例12: editorScript
/**
* Used by the frontend adminsitration to save editor field contents
*
* @param string $editor1 the name of the editor field no. 1
* @param string $editor2 the name of the editor field no. 2
*/
function editorScript($editor1 = '', $editor2 = '')
{
?>
<script type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
<?php
if ($editor1 != '') {
if (vmIsJoomla(1.5)) {
jimport('joomla.html.editor');
$editor = JEditor::getInstance($GLOBALS['mainframe']->getCfg('editor'));
echo $editor->getContent('editor1');
} else {
getEditorContents('editor1', $editor1);
}
}
if ($editor2 != '') {
if (vmIsJoomla(1.5)) {
jimport('joomla.html.editor');
$editor = JEditor::getInstance($GLOBALS['mainframe']->getCfg('editor'));
echo $editor->getContent('editor2');
} else {
getEditorContents('editor2', $editor2);
}
}
?>
submitform( pressbutton );
}
</script><?php
}
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:41,代码来源:ps_main.php
示例13: getEditor
/**
* Get an editor object.
*
* @param string $editor The editor to load, depends on the editor plugins that are installed
*
* @return JEditor object
*
* @since 11.1
*/
public static function getEditor($editor = null)
{
jimport('joomla.html.editor');
// Get the editor configuration setting
if (is_null($editor)) {
$conf = self::getConfig();
$editor = $conf->get('editor');
}
return JEditor::getInstance($editor);
}
开发者ID:renzhewk,项目名称:joomla-platform,代码行数:19,代码来源:factory.php
示例14: getEditor
/**
* Get an editor object.
*
* @param string $editor The editor to load, depends on the editor plugins that are installed
*
* @return JEditor instance of JEditor
*
* @since 11.1
* @deprecated 12.2 CMS developers should use JEditor directly.
* @note There is no direct replacement in the Joomla Platform.
*/
public static function getEditor($editor = null)
{
JLog::add(__METHOD__ . ' is deprecated. CMS developers should use JEditor directly.', JLog::WARNING, 'deprecated');
if (!class_exists('JEditor')) {
throw new BadMethodCallException('JEditor not found');
}
JLog::add(__METHOD__ . ' is deprecated. Use JEditor directly.', JLog::WARNING, 'deprecated');
// Get the editor configuration setting
if (is_null($editor)) {
$conf = self::getConfig();
$editor = $conf->get('editor');
}
return JEditor::getInstance($editor);
}
开发者ID:houzhenggang,项目名称:cobalt,代码行数:25,代码来源:factory.php
示例15: getHTML
function getHTML()
{
JFactory::getApplication()->setUserState('editor.source.syntax', 'php');
$editor_plugin = JPluginHelper::getPlugin('editors', 'codemirror');
if (empty($editor_plugin)) {
JFactory::getApplication()->enqueueMessage(JText::sprintf('SRC_ERROR_CODEMIRROR_DISABLED', '<a href="index.php?option=com_plugins&filter_folder=editors&filter_search=codemirror" target="_blank">', '</a>'), 'error');
return;
}
$editor = JEditor::getInstance('codemirror');
ob_start();
?>
<div class="header">
<h1 class="page-title">
<span class="icon-nonumber icon-sourcerer"></span>
<?php
echo JText::_('INSERT_CODE');
?>
</h1>
</div>
<div class="subhead">
<div class="container-fluid">
<div class="btn-toolbar" id="toolbar">
<div class="btn-group" id="toolbar-apply">
<button href="#" onclick="nnSourcererPopup.insertText();window.parent.SqueezeBox.close();" class="btn btn-small btn-success">
<span class="icon-apply icon-white"></span> <?php
echo JText::_('SRC_INSERT');
?>
</button>
</div>
<div class="btn-group">
<button class="btn btn-small hasTip" id="btn-sourcetags" onclick="nnSourcererPopup.toggleSourceTags();return false;" title="<?php
echo JText::_('SRC_TOGGLE_SOURCE_TAGS_DESC');
?>
">
<span class="icon-nonumber icon-src-sourcetags"></span> <?php
echo JText::_('SRC_TOGGLE_SOURCE_TAGS');
?>
</button>
</div>
<div class="btn-group">
<button class="btn btn-small hasTip" id="btn-tagstyle" onclick="nnSourcererPopup.toggleTagStyle();return false;" title="<?php
echo JText::_('SRC_TOGGLE_TAG_STYLE_DESC');
?>
">
<span class="icon-nonumber icon-src-tagstyle"></span> <?php
echo JText::_('SRC_TOGGLE_TAG_STYLE');
?>
</button>
</div>
<div class="btn-group" id="toolbar-cancel">
<button href="#" onclick="if(confirm('<?php
echo JText::_('NN_ARE_YOU_SURE');
?>
')){window.parent.SqueezeBox.close();}" class="btn btn-small">
<span class="icon-cancel "></span> <?php
echo JText::_('JCANCEL');
?>
</button>
</div>
<?php
if (JFactory::getApplication()->isAdmin() && JFactory::getUser()->authorise('core.admin', 1)) {
?>
<div class="btn-wrapper" id="toolbar-options">
<button onclick="window.open('index.php?option=com_plugins&filter_folder=system&filter_search=sourcerer');" class="btn btn-small">
<span class="icon-options"></span> <?php
echo JText::_('JOPTIONS');
?>
</button>
</div>
<?php
}
?>
</div>
</div>
</div>
<div class="container-fluid container-main">
<form action="index.php" id="sourceForm" method="post">
<div class="control-group form-inline">
</div>
<div class="well well-small src_editor">
<?php
echo $editor->display('source', $this->params->code, '100%', '100%', 10, 10, 0, null, null, null, array('linenumbers' => 1, 'tabmode' => 'shift'));
?>
</div>
<script type="text/javascript">
nnSourcererPopup.init();
</script>
</form>
</div>
<?php
$html = ob_get_contents();
//.........这里部分代码省略.........
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:101,代码来源:popup.php
示例16: testGetState
/**
* Tests the getState method
*
* @return void
*
* @since 3.0
*/
public function testGetState()
{
// Preload the state to test it
TestReflection::setValue($this->object, '_state', 'JEditor::getState()');
$this->assertThat($this->object->getState(), $this->equalTo('JEditor::getState()'));
}
开发者ID:n3t,项目名称:joomla-cms,代码行数:13,代码来源:JEditorTest.php
示例17: testAttachWithClass
/**
* @testdox Test an observer object is correctly stored in the JEditor class
*
* @since 3.4.4
*/
public function testAttachWithClass()
{
$testObserver = new EditorObserver();
$this->object->attach($testObserver);
$this->assertAttributeSame(array($testObserver), '_observers', $this->object, 'Observer was not attached to the editor');
}
开发者ID:SysBind,项目名称:joomla-cms,代码行数:11,代码来源:JEditorTest.php
示例18: render
/**
* Draws the html form element
*
* @param array $data To pre-populate element with
* @param int $repeatCounter Repeat group counter
*
* @return string Elements html
*/
public function render($data, $repeatCounter = 0)
{
$name = $this->getHTMLName($repeatCounter);
$id = $this->getHTMLId($repeatCounter);
$element = $this->getElement();
if ($element->hidden == '1') {
return $this->getHiddenField($name, $this->getValue($data, $repeatCounter), $id);
}
$params = $this->getParams();
$cols = $params->get('width', $element->width);
$rows = $params->get('height', $element->height);
$value = $this->getValue($data, $repeatCounter);
$bits = array();
$bits['class'] = "fabrikinput inputbox " . $params->get('bootstrap_class');
$wysiwyg = $this->useWysiwyg();
if (!$this->isEditable()) {
if ($params->get('textarea-tagify') == true) {
$value = $this->tagify($value);
} else {
if (!$wysiwyg) {
$value = nl2br($value);
}
if ($value !== '' && ((int) $params->get('textarea-truncate-where', 0) === 2 || (int) $params->get('textarea-truncate-where', 0) === 3)) {
$opts = $this->truncateOpts();
$value = fabrikString::truncate($value, $opts);
}
}
return $value;
}
if ($params->get('textarea_placeholder', '') !== '') {
$bits['placeholder'] = $params->get('textarea_placeholder');
}
if ($this->elementError != '') {
$bits['class'] .= ' elementErrorHighlight';
}
$layoutData = new stdClass();
$this->charsLeft($value, $layoutData);
if ($wysiwyg) {
$editor = JEditor::getInstance($this->config->get('editor'));
$buttons = (bool) $params->get('wysiwyg_extra_buttons', true);
$layoutData->editor = $editor->display($name, $value, $cols * 10, $rows * 15, $cols, $rows, $buttons, $id);
$layout = $this->getLayout('wysiwyg');
} else {
if ($params->get('disable')) {
$bits['class'] .= " disabled";
$bits['disabled'] = 'disabled';
}
if ($params->get('textarea-showmax') && $params->get('textarea_limit_type', 'char') === 'char') {
$bits['maxlength'] = $params->get('textarea-maxlength');
}
$bits['name'] = $name;
$bits['id'] = $id;
$bits['cols'] = $cols;
$bits['rows'] = $rows;
$layoutData->attributes = $bits;
$layoutData->value = $value;
$layout = $this->getLayout('form');
}
return $layout->render($layoutData);
}
开发者ID:LGBGit,项目名称:tierno,代码行数:68,代码来源:textarea.php
示例19: FORMS_MENU_SAVE_CANCEL
/**
* The function to handle all default page situations
* not responsible for lists!
*/
function FORMS_MENU_SAVE_CANCEL()
{
global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_lang, $VM_LANG, $page, $limitstart, $vmIcons;
$no_menu = (int) $_REQUEST['no_menu'];
$bar =& vmToolBar::getInstance('virtuemart');
$is_iframe = vmGet($_REQUEST, 'is_iframe', 0);
$product_parent_id = vmGet($_REQUEST, 'product_parent_id', 0);
$product_id = vmGet($_REQUEST, 'product_id');
$script = '';
if (is_array($product_id)) {
$product_id = "";
}
// These editor arrays tell the toolbar to load correct "getEditorContents" script parts
// This is necessary for WYSIWYG Editors like TinyMCE / mosCE / FCKEditor
$editor1_array = array('product.product_form' => 'product_desc', 'shopper.shopper_group_form' => 'shopper_group_desc', 'product.product_category_form' => 'category_description', 'manufacturer.manufacturer_form' => 'mf_desc', 'store.store_form' => 'vendor_store_desc', 'product.product_type_parameter_form' => 'parameter_description', 'product.product_type_form' => 'product_type_description', 'vendor.vendor_form' => 'vendor_store_desc');
$editor2_array = array('store.store_form' => 'vendor_terms_of_service', 'vendor.vendor_form' => 'vendor_terms_of_service');
$editor1 = isset($editor1_array[$page]) ? $editor1_array[$page] : '';
$editor2 = isset($editor2_array[$page]) ? $editor2_array[$page] : '';
if ($no_menu) {
vmCommonHTML::loadExtJS();
}
$script .= '
var submitbutton = function(pressbutton){
var form = document.adminForm;
if (pressbutton == \'cancel\') {
submitform( pressbutton );
return;
}
';
if ($editor1 != '') {
if (vmIsJoomla(1.5)) {
jimport('joomla.html.editor');
$editor_type = $GLOBALS['mainframe']->getCfg('editor');
if ($editor_type != 'none') {
$editor = JEditor::getInstance();
$script .= $editor->getContent($editor1);
}
} else {
ob_start();
getEditorContents('editor1', $editor1);
$script .= ob_get_contents();
ob_end_clean();
}
}
if ($editor2 != '') {
if (vmIsJoomla(1.5)) {
jimport('joomla.html.editor');
$editor_type = $GLOBALS['mainframe']->getCfg('editor');
if ($editor_type != 'none') {
$editor = JEditor::getInstance();
$script .= $editor->getContent($editor2);
}
} else {
ob_start();
getEditorContents('editor2', $editor2);
$script .= ob_get_contents();
ob_end_clean();
}
}
if ($no_menu) {
$admin = defined('_VM_IS_BACKEND') ? '/administrator' : '';
$script .= "\r\n // define some private variables\r\n var dialog, showBtn;\r\n\r\n var showDialog = function( content ) {\r\n \tExt.Msg.show( { \r\n \t\ttitle: '" . $VM_LANG->_('PEAR_LOG_NOTICE') . "',\r\n \t\tmsg: content,\r\n \t\tautoCreate: true,\r\n width:400,\r\n height:180,\r\n modal: false,\r\n resizable: false,\r\n buttons: Ext.Msg.OK,\r\n shadow:true,\r\n animEl:Ext.get( 'vm-toolbar' )\r\n });\r\n " . (DEBUG ? "" : "setTimeout('Ext.Msg.hide()', 3000);") . "\r\n };\r\n \r\n // return a public interface\r\n var onSuccess = function(o,c) {\r\n\t\tshowDialog( o.responseText );\r\n\t};\r\n var onFailure = function(o) {\r\n\t\tExt.Msg.alert( 'Error!', 'Save action failed: ' + o.statusText );\r\n\t};\r\n\tvar onCallback=function(o,s,r) {\r\n\t\t//if( s ) alert( 'Success' );\r\n\t\t//else alert( 'Failure' );\r\n\t}\r\n\t\r\n \tExt.Ajax.request( { method: 'POST',\r\n \t\t\t\t\t\turl: '{$_SERVER['PHP_SELF']}',\r\n \t\t\t\t\t\tsuccess: onSuccess,\r\n \t\t\t\t\t\tfailure: onFailure,\r\n \t\t\t\t\t\tcallback: onCallback,\r\n \t\t\t\t\t\tisUpload: true,\r\n \t\t\t\t\t\tform: document.adminForm,\r\n \t\t\t\t\t\tparams: { no_html:1 }\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t);\r\n\t";
} else {
$script .= "\n\t\t\tsubmitform( pressbutton );\n";
}
$script .= "\t\t}\n";
$bar->buttons .= $script;
if ($page == "product.product_form" && !empty($product_id)) {
if (empty($product_parent_id)) {
// add new attribute
$href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_attribute_form&product_id=" . $product_id . "&limitstart=" . $limitstart . "&no_menu={$no_menu}";
$alt = $VM_LANG->_('PHPSHOP_ATTRIBUTE_FORM_MNU');
$bar->customHref($href, 'new', $alt);
} else {
// back to parent product
$href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_form&product_id={$product_parent_id}&limitstart=" . $limitstart . "&no_menu={$no_menu}";
$alt = $VM_LANG->_('PHPSHOP_PRODUCT_FORM_RETURN_LBL');
$bar->customHref($href, $vmIcons['back_icon'], $vmIcons['back_icon2'], $alt);
// new child product
$href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_form&product_parent_id={$product_parent_id}&limitstart=" . $limitstart . "&no_menu={$no_menu}";
$alt = $VM_LANG->_('PHPSHOP_PRODUCT_FORM_ADD_ANOTHER_ITEM_MNU');
$bar->customHref($href, 'new', $alt);
}
// Go to Price list
$href = $_SERVER['PHP_SELF'] . "?page=product.product_price_list&product_id={$product_id}&product_parent_id={$product_parent_id}&limitstart={$limitstart}&return_args=&option=com_virtuemart&no_menu={$no_menu}";
$alt = $VM_LANG->_('PHPSHOP_PRICE_LIST_MNU');
$bar->customHref($href, 'new', $alt);
// add product type
$href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_product_type_form&product_id={$product_id}&product_parent_id={$product_parent_id}&limitstart={$limitstart}&no_menu={$no_menu}";
$alt = $VM_LANG->_('PHPSHOP_PRODUCT_PRODUCT_TYPE_FORM_MNU');
$bar->customHref($href, 'new', $alt);
/*** Adding an item is only pssible, if the product has attributes ***/
if (ps_product::product_has_attributes($product_id)) {
// Add Item
$href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_form&product_parent_id={$product_id}&limitstart={$limitstart}&no_menu={$no_menu}";
//.........这里部分代码省略.........
开发者ID:albertobraschi,项目名称:Hab,代码行数:101,代码来源:toolbar.html.php
示例20: switch
?>
</label></div></dt>
<dd><div class="controls btl-input">
<?php
switch ($el->type) {
case 'date':
if ($el->value == '' || $el->value == '0000-00-00') {
$el->value = null;
}
echo JHTML::_('calendar', $el->value, 'user_fields[' . $el->alias . ']', 'user_fields_' . $el->alias, '%Y-%m-%d ', $required);
break;
case 'string':
echo '<input size="35" ' . $required . ' type="text" name="user_fields[' . $el->alias . ']" value="' . $el->value . '">';
break;
case 'text':
$wysiwyg = JEditor::getInstance();
echo $wysiwyg->display('user_fields[' . $el->alias . ']', strip_tags($el->value), '365', '140', '75', '20', false);
break;
case 'dropdown':
$options = array();
$options[] = JHtml::_('select.option', '', $el->default_values['label']);
foreach ($el->default_values['value'] as $value) {
$options[] = JHtml::_('select.option', $value, $value);
}
echo JHtml::_('select.genericlist', $options, 'user_fields[' . $el->alias . '][]', $required, 'value', 'text', $el->value);
break;
case 'image':
if ($el->value != '') {
$avatar = '<img src="' . JURI::root() . 'images/bt_socialconnect/avatar/' . $el->value . '"/>';
$html = '<div class=\'imageupload\'>';
$html .= '<span class="editlinktip hasTip" title="' . htmlspecialchars($avatar) . '">';
开发者ID:juanferden,项目名称:adoperp,代码行数:31,代码来源:default_userfields.php
注:本文中的JEditor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论