本文整理汇总了PHP中JHtmlBehavior::framework方法的典型用法代码示例。如果您正苦于以下问题:PHP JHtmlBehavior::framework方法的具体用法?PHP JHtmlBehavior::framework怎么用?PHP JHtmlBehavior::framework使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JHtmlBehavior
的用法示例。
在下文中一共展示了JHtmlBehavior::framework方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Display method
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
*/
public function display($tpl = null)
{
$objJSNUtils = JSNISFactory::getObj('classes.jsn_is_utils');
$objJSNXML = JSNISFactory::getObj('classes.jsn_is_readxmldetails');
$objJSNMsg = JSNISFactory::getObj('classes.jsn_is_message');
// Get config parameters
$config = JSNConfigHelper::get();
$this->_document = JFactory::getDocument();
JHtmlBehavior::framework();
// Set the toolbar
JToolBarHelper::title(JText::_('JSN_IMAGESHOW') . ': ' . JText::_('HELP_HELP_AND_SUPPORT'), 'help');
$shortEdition = '';
$xml = array();
// Get messages
$msgs = '';
$msgs = $objJSNMsg->getList('HELP_AND_SUPPORT');
$msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
$xml = $objJSNXML->parserXMLDetails();
$shortEdition = $objJSNUtils->getShortEdition();
// Assign variables for rendering
$this->assignRef('msgs', $msgs);
$this->assignRef('xml', $xml);
$this->assignRef('shortEdition', $shortEdition);
$this->_addAssets();
$this->addToolbar();
// Display the template
parent::display($tpl);
}
示例2: display
function display($tpl = null)
{
if (JVERSION < 3.0) {
JHTML::_('behavior.mootools');
} else {
JHtmlBehavior::framework();
}
$this->_setToolBar();
$this->setLayout('settings');
$model = $this->getModel('settings');
$gatewayplugin = $this->get('APIpluginData');
$this->assignRef('gatewayplugin', $gatewayplugin);
$model->refreshUpdateSite();
$geotable_list = $model->checkgeotables();
if (!empty($geotable_list)) {
$geotablepresent = 0;
} else {
$geotablepresent = 1;
}
$this->assignRef('geotablepresent', $geotablepresent);
if (JVERSION >= 3.0) {
$this->sidebar = JHtmlSidebar::render();
}
parent::display($tpl);
}
示例3: 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) . '需要先啟動外掛!';
}
$name = str_replace('jform_params_', '', $this->id);
\JHtmlBehavior::framework(true);
$token = JFactory::getSession()->getFormToken();
$ajaxUrl = JURI::root() . 'index.php?cmd=ajax.overlay.' . $name;
$ajaxCode = <<<AJAX
window.addEvent('domready', function() {
\t\$('{$name}').addEvent('click', function(e) {
\t\tvar myRequest = new Request({
\t\t\tmethod: 'post',
\t\t\tdata: {
\t\t\t\t'{$token}': 1
\t\t\t},
\t\t\turl: '{$ajaxUrl}',
\t\t\tonSuccess: function(responseText) {
\t\t\t\t\$('{$name}_response').set('html', '<input class="btn btn-default" disabled="true" type="button" value="'+responseText+'">');
\t\t\t}
\t\t});
\t\tmyRequest.send();
\t});
});
AJAX;
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($ajaxCode);
$link = '<div id="' . $name . '_response" ><input class="btn btn-default" id="' . $name . '" type="button" value="按此覆蓋"></div>';
return $link;
}
示例4: fetchButton
function fetchButton($type = 'Wizard', $namekey = '', $id = 'wizard')
{
if (version_compare(JVERSION, '3.0.0', '<')) {
JHTML::_('behavior.mootools');
} else {
JHtmlBehavior::framework();
}
$defaultPage = 'jnewsdoc_glossary';
if (empty($namekey)) {
$namekey = $defaultPage;
} else {
$namekey = 'jnewsdoc_' . $namekey;
}
$langID = substr(JNEWS_CONFIG_LANG, 0, 2);
$link = 'http://www.joobi.co/index.php?option=com_jlinks&controller=redirect&link=' . $namekey . '&alt=' . $defaultPage . '&lang=' . $langID;
//.'&Itemid=312';
$iFrame = "'<iframe src=\\'{$link}\\' width=\\'100%\\' height=\\'100%\\' scrolling=\\'auto\\'></iframe>'";
$js = "var wizardOn = true; function showWizard(){\n\t\tvar box=\$('jNewsWizard');\n\t\tif(wizardOn){box.innerHTML = " . $iFrame . ";box.style.display = 'block';box.style.height = '0';}";
$js .= "try{\n var fx = box.effects({duration: 2500, transition:\n\t\t\t\t\tFx.Transitions.Quart.easeOut});\n\t\t\t\t\tif(wizardOn){\n\t\t\t\t\t\tfx.start({'height': 500});\n\t\t\t\t\t}else{\n\t\t\t\t\t\tfx.start({'height': 0}).chain(function() {\n\t\t\t\t\t\t\tbox.innerHTML='';\n\t\t\t\t\t\t\tbox.setStyle('display','none');\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}catch(err){\n\t\t\t\t\tbox.style.height = '500px';\n\t\t\t\t\tvar myVerticalSlide = new Fx.Slide('jNewsWizard');\n \t\t\t\t\tif(wizardOn){\n\t\t\t\t\t\tmyVerticalSlide.slideIn();\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmyVerticalSlide.slideOut().chain(function() {\n\t\t\t\t\t\tbox.innerHTML='';\n\t\t\t\t\t\tbox.setStyle('display','none');\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} wizardOn = !wizardOn;}";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
if (version_compare(JVERSION, '3.0.0', '<')) {
return '<a href="' . $link . '" target="_blank" onclick="showWizard();return false;" class="toolbar"><span class="icon-32-wizard" title="' . _JNEWS_WIZARD . '"></span>' . _JNEWS_WIZARD . '</a>';
} else {
return '<a class="btn btn-small" href="' . $link . '" target="_blank" onclick="showWizard();return false;" class="toolbar"><span style="float:left;" class="icon-16-wizard" title="' . _JNEWS_WIZARD . '"></span><span style="float:left; margin-left:8px;">' . _JNEWS_WIZARD . '</span></a>';
}
}
示例5: __construct
/**
* Constructor
*
* @access protected
* @return void
* @since 1.5.5
*/
function __construct($config = array())
{
parent::__construct($config);
$this->_ambit = JoomAmbit::getInstance();
$this->_config = JoomConfig::getInstance();
$this->_mainframe = JFactory::getApplication('administrator');
$this->_user = JFactory::getUser();
$this->_doc = JFactory::getDocument();
$this->_doc->addStyleSheet($this->_ambit->getStyleSheet('admin.joomgallery.css'));
JHtmlBehavior::framework();
$this->_doc->addScript($this->_ambit->getScript('admin.js'));
JoomHelper::addSubmenu();
JHTML::addIncludePath(JPATH_COMPONENT . '/helpers/html');
// Check for available updates
if (!($checked = $this->_mainframe->getUserState('joom.update.checked'))) {
$controller = JRequest::getCmd('controller');
if ($this->_config->get('jg_checkupdate') && $controller && $controller != 'control') {
$dated_extensions = JoomExtensions::checkUpdate();
if (count($dated_extensions)) {
$this->_mainframe->enqueueMessage(JText::_('COM_JOOMGALLERY_ADMENU_SYSTEM_NOT_UPTODATE'), 'warning');
$this->_mainframe->setUserState('joom.update.checked', -1);
} else {
$this->_mainframe->setUserState('joom.update.checked', 1);
}
}
} else {
if ($checked == -1) {
$controller = JRequest::getCmd('controller');
if ($controller && $controller != 'control') {
$this->_mainframe->enqueueMessage(JText::_('COM_JOOMGALLERY_ADMENU_SYSTEM_NOT_UPTODATE'), 'warning');
}
}
}
}
示例6: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*/
public function getInput()
{
// Load the modal behavior script.
JHtml::_('behavior.modal', 'a.modal');
JHtmlBehavior::framework(true);
$this->setElement();
// Build the script.
$script = array();
$script[] = ' function jSelect' . ucfirst($this->component) . '_' . $this->id . '(id, title) {';
$script[] = ' document.id("jform_link").value = id;';
$script[] = ' document.id("jform_link").highlight();';
$script[] = ' SqueezeBox.close();';
$script[] = ' }';
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
// Setup variables for display.
$html = array();
$link = $this->getLink();
$title = $this->getTitle();
if (empty($title)) {
$title = JText::_('COM_' . strtoupper($this->component) . '_SELECT_ITEM');
}
$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
if (JVERSION >= 3) {
// The current user display field.
$html[] = '<span class="">';
$html[] = '<a class="modal btn" title="' . JText::_('COM_' . strtoupper($this->component) . '_CHANGE_ITEM_BUTTON') . '" href="' . $link . '&' . JSession::getFormToken() . '=1" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> ' . JText::_('JSELECT') . '</a>';
$html[] = '</span>';
} else {
// The user select button.
$html[] = '<div class="button2-left">';
$html[] = ' <div class="blank">';
$html[] = ' <a class="modal" title="' . JText::_('COM_' . strtoupper($this->component) . '_CHANGE_ITEM') . '" href="' . $link . '&' . JSession::getFormToken() . '=1" rel="{handler: \'iframe\', size: {x: 800, y: 450}}">' . JText::_('JSELECT') . '</a>';
$html[] = ' </div>';
$html[] = '</div>';
}
// The active article id field.
if (0 == (int) $this->value) {
$value = '';
} else {
$value = (int) $this->value;
}
// class='required' for client side validation
$class = '';
if ($this->required) {
$class = ' class="required modal-value"';
}
$html[] = '<input type="hidden" id="' . $this->id . '_id"' . $class . ' name="' . $this->name . '" value="' . $value . '" />';
return implode("\n", $html);
}
示例7: display
/**
* Display method
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
*/
public function display($tpl = null)
{
// Get config parameters
$config = JSNConfigHelper::get();
$this->_document = JFactory::getDocument();
JHtmlBehavior::framework();
// Set the toolbar
JToolBarHelper::title(JText::_('JSN_IMAGESHOW') . ': ' . JText::_('MAINTENANCE_CONFIGURATION_AND_MAINTENANCE'), 'maintenance');
// Get messages
$msgs = '';
if (!$config->get('disable_all_messages')) {
$msgs = JSNUtilsMessage::getList('CONFIGURATION_AND_MAINTENANCE');
$msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
}
// Assign variables for rendering
$this->assignRef('msgs', $msgs);
$this->_addAssets();
$this->addToolbar();
// Type of screen
$type = JRequest::getWord('type', 'backup');
$themeName = JRequest::getWord('theme_name');
$sourceType = JRequest::getString('source_type');
switch ($type) {
case 'themeparameters':
$this->addTemplatePath(JPATH_PLUGINS . DS . 'jsnimageshow' . DS . $themeName . DS . 'views' . DS . 'maintenance' . DS . 'tmpl');
echo $this->loadTemplate('theme_config');
break;
case 'profileparameters':
$this->addTemplatePath(JPATH_PLUGINS . DS . 'jsnimageshow' . DS . $sourceType . DS . 'views' . DS . 'maintenance' . DS . 'tmpl');
echo $this->loadTemplate('source_config');
break;
case 'editprofile':
$sourceID = JRequest::getInt('external_source_id');
$countShowlist = JRequest::getInt('count_showlist');
$imageSource = JSNISFactory::getSource($sourceType, 'external');
$imageSource->_source['sourceTable']->load($sourceID);
$this->assignRef('sourceInfo', $imageSource->_source['sourceTable']);
$this->assignRef('countShowlist', $countShowlist);
$this->addTemplatePath(JPATH_PLUGINS . DS . 'jsnimageshow' . DS . 'source' . $sourceType . DS . 'views' . DS . 'maintenance' . DS . 'tmpl');
echo $this->loadTemplate('edit_source_profile');
break;
default:
// Display the template
parent::display($tpl);
break;
}
}
示例8: getInput
/**
* Method to get the field options.
*
* @return array The field option objects.
* @since 1.6
*/
public function getInput()
{
// load core and extra mootools
JHTML::_('behavior.framework');
JHtmlBehavior::framework();
JHtmlBehavior::framework(true);
// Must load admin language files
$lang = JFactory::getLanguage();
$lang->load("com_jevents", JPATH_ADMINISTRATOR);
$node = $this->element;
$value = $this->value;
$name = $this->name;
$control_name = $this->type;
$help = $node['help'];
if (!is_null($help) && version_compare(JVERSION, '1.6.0', ">=")) {
if (is_object($help)) {
$help = (string) $help;
}
$help = isset($help) && JString::strlen($help) <= 0 ? null : $help;
}
if (!is_null($help)) {
$parts = explode(",", $value);
$helps = explode(",", $help);
foreach ($parts as $key => $valuepart) {
$help = $helps[$key];
list($helpfile, $varname, $part) = explode("::", $help);
$lang = JFactory::getLanguage();
$langtag = $lang->getTag();
if (file_exists(JPATH_COMPONENT_ADMINISTRATOR . '/help/' . $langtag . '/' . $helpfile)) {
$jeventHelpPopup = JPATH_COMPONENT_ADMINISTRATOR . '/help/' . $langtag . '/' . $helpfile;
} else {
$jeventHelpPopup = JPATH_COMPONENT_ADMINISTRATOR . '/help/en-GB/' . $helpfile;
}
if (!file_exists($jeventHelpPopup)) {
return "";
}
include $jeventHelpPopup;
$help = $this->help(${$varname}, $part);
$parts[$key] = JText::_($valuepart) . $help;
}
$value = implode(", ", $parts);
}
JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php");
JEVHelper::ConditionalFields($this->element, $this->form->getName());
return "<strong style='color:#993300'>" . JText::_($value) . "</strong>";
}
示例9: register
/**
* register
*
* @return void
*/
public static function register()
{
/** @var $doc \JDocumentHtml */
$doc = \JFactory::getDocument();
$es = \Ezset::getInstance();
$input = \JFactory::getApplication()->input;
if ($doc->getType() !== 'html') {
return;
}
$uri = \JUri::getInstance();
$root = $uri::root();
$base = $uri::base();
$host = $uri->toString(array('scheme', 'host')) . '/';
if ($smoothScroll = $es->params->get('smoothScroll', 0)) {
\JHtmlBehavior::framework(true);
}
$smoothScroll = $smoothScroll ? 'true' : 'false';
$confirmLeave = $es->params->get('confirmLeave', 0) && UriChecker::isArticleEdit() ? 'true' : 'false';
$logoLink = \JFactory::getApplication()->isAdmin() ? 'true' : 'false';
$script = <<<SCRIPT
<script type="text/javascript">
\tvar ezsetOption = {
\t\tsmoothScroll: {$smoothScroll},
\t\tconfirmLeave: {$confirmLeave},
\t\tlogoLink: {$logoLink}
\t};
\tvar ezsetConfig = {
\t\troot : '{$root}',
\t\tbase : '{$base}',
\t\thost : '{$host}'
\t};
\tEzset.init(ezsetOption, ezsetConfig);
</script>
SCRIPT;
$doc->addCustomTag($script);
$doc->addScript(\JUri::root(true) . '/plugins/system/ezset/asset/js/ezset.js');
$doc->addScript(\JUri::root(true) . '/ezset/js/ezset-custom.js');
}
示例10: addMedia
/**
*
* Parse all queue to page
*
*/
public function addMedia()
{
$document = JFactory::getDocument();
$docType = $document->getType();
if ($this->_load_js_language) {
JSNFactory::localimport('libraries.joomlashine.language.javascriptlanguages');
$jsLang = JSNJavascriptLanguages::getInstance();
$this->addScriptDeclaration($jsLang->loadLang());
}
if ($this->_docType == 'raw') {
$medias = array();
//Add all style file to page
if (count($this->_styles)) {
foreach ($this->_styles as $style) {
$medias[] = '<link type="text/css" rel="stylesheet" href="' . $style . '" />';
}
}
//Add all script file to page
if (count($this->_scripts)) {
foreach ($this->_scripts as $script) {
$medias[] = '<script type="text/javascript" src="' . $script . '"></script>';
}
if (!in_array(PoweradminHelper::makeUrlWithSuffix(JSN_POWERADMIN_LIB_JSNJS_URI . 'conflict.js'), $this->_scripts)) {
$medias[] = '<script type="text/javascript" src="' . PoweradminHelper::makeUrlWithSuffix(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.conflict.js') . '"></script>';
}
}
//Add all custom tag to page
if (count($this->_customs)) {
foreach ($this->_customs as $custom) {
$medias[] = $custom;
}
}
//Add all style declaration to page
if (count($this->_styleDeclaration)) {
$medias[] = '<style type="text/css">' . implode(PHP_EOL, $this->_styleDeclaration) . '</style>';
}
//Add all script declaration to page
if (count($this->_scriptDeclaration)) {
$medias[] = '<script type="text/javascript">' . implode(PHP_EOL, $this->_scriptDeclaration) . '</script>';
}
echo implode(PHP_EOL, $medias);
} else {
//behavior mootools
JHtmlBehavior::framework();
//behavior modal
JHtml::_('behavior.modal');
//behavior tooltip
JHtml::_('behavior.tooltip');
//behavior formvalidation
JHtml::_('behavior.formvalidation');
//behavior combobox
JHtml::_('behavior.combobox');
//Add all style file to page
if (count($this->_styles)) {
foreach ($this->_styles as $style) {
$document->addStyleSheet($style);
}
}
$system_js = array();
$user_js = array();
$docScripts = $document->_scripts;
if (count($docScripts)) {
foreach ($docScripts as $key => $script) {
if (strpos($key, '/media/system/') !== false) {
$system_js[$key] = $script;
} else {
if (!is_jquery($key)) {
$user_js[$key] = $script;
}
}
}
$document->_scripts = array();
}
//Add all script file to page
if (count($this->_scripts)) {
foreach ($this->_scripts as $script) {
JSNHtmlAsset::addScript($script);
}
if (!in_array(PoweradminHelper::makeUrlWithSuffix(JSN_POWERADMIN_LIB_JSNJS_URI . 'conflict.js'), $this->_scripts)) {
JSNHtmlAsset::addScript(PoweradminHelper::makeUrlWithSuffix(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.conflict.js'));
}
}
$docScripts = $document->_scripts;
$index = 0;
$jsn_jquery = array();
foreach ($docScripts as $key => $script) {
if ($index < 2) {
$jsn_jquery[$key] = $script;
} else {
$user_js[$key] = $script;
}
$index++;
}
$document->_scripts = $system_js + $jsn_jquery + $user_js;
//Add all custom tag to page
//.........这里部分代码省略.........
示例11: list
if (strpos($task = $input->getCmd('task', ''), '.') !== false) {
list($controller, $task) = explode('.', $task, 2);
}
if ($controller == "updater") {
$controller = "update";
}
if ($controller == "configuration") {
$controller = "maintenance";
JRequest::setVar('view', $controller);
}
if ($controller == "update" || $controller == "installer" || $controller == "upgrade") {
JRequest::setVar('view', $controller);
}
if ($option != 'image' && $task != 'editimage') {
if ($view != 'update' && $view != 'upgrade' && $view != 'about') {
JHtmlBehavior::framework(true);
}
}
// Check if all dependency is installed
if ($tmpl !== 'component') {
include_once JPATH_COMPONENT_ADMINISTRATOR . '/dependency.php';
}
if ($controller) {
$path = JPATH_COMPONENT_ADMINISTRATOR . DS . 'controllers' . DS . $controller . '.php';
if (file_exists($path)) {
require_once $path;
} else {
$controller = '';
}
}
$classname = 'ImageShowController' . $controller;
示例12: jnewsbot_content_editab
function jnewsbot_content_editab($forms)
{
if (version_compare(JVERSION, '3.0.0', '<')) {
JHTML::_('behavior.mootools');
} else {
JHtmlBehavior::framework();
}
$siteContent = new siteContent();
// $limit = -1;
$limit = 5;
$limittotal = $siteContent->countSiteCount();
$setLimit = jnews::setLimitPagination($limittotal);
$action = JRequest::getVar('act', '', '', 'WORD');
$task = JRequest::getVar('task');
$contentsearch = JRequest::getVar('contentsearch', '');
echo $forms['main'];
$hidden = '<input type="hidden" name="option" value="' . JNEWS_OPTION . '" />';
$hidden .= '<input type="hidden" name="limit" value="' . $limit . '" />';
$toSearch = new stdClass();
$toSearch->forms = '';
$toSearch->hidden = $hidden;
$toSearch->listsearch = $contentsearch;
$toSearch->id = 'contentsearch';
$app = JFactory::getApplication();
$setSort = new stdClass();
if (!isset($_POST['c_filter_order'])) {
$setSort->orderValue = "a.id";
} else {
$setSort->orderValue = $_POST['filter_order'];
}
//$setSort->orderValue = $app->getUserStateFromRequest(JNEWS_OPTION . '.content.filter_order', 'filter_order', 'a.id', 'cmd');
$setSort->orderDir = $app->getUserStateFromRequest(JNEWS_OPTION . '.content.filter_order_Dir', 'filter_order_Dir', 'desc', 'word');
//$setSort->orderValue = "a.id";
$contentItems = jnewsbot_content_getitems($contentsearch, $setLimit, $setSort);
ob_start();
$js = "function setContentTag(id, url, changeType , hide_title)\n {\n\n if(hide_title ==undefined)\n {\n var check_title = document.getElementById('hide_title_no').checked;\n if(check_title) hide_title = 0;\n else hide_title = 1;\n\n }\n\n\n\n var form = document.adminForm;\n if(!form)\n {\n form = document.mosForm;\n }\n\n if(form.content_type[2].checked === false)\n {\n document.getElementById('hide_title_yes').disabled=false;\n }\n else\n {\n document.getElementById('hide_title_no').click();\n hide_title = 0;\n document.getElementById('hide_title_yes').disabled=true;\n }\n if(id!=null)\n {\n for (i=0; i<form.content_type.length; i++)\n {\n if (form.content_type[i].checked)\n {\n var content_type = form.content_type[i].value;\n }\n }";
// if ( @include_once( JNEWSPATH_ADMIN . 'social' .DS. 'class.social.php' ) ) {
if (!$GLOBALS[JNEWS . 'use_tags'] and class_exists('jNews_Social') or !$GLOBALS[JNEWS . 'use_tags'] and $GLOBALS[JNEWS . 'level'] > 2) {
$js .= "\n if(changeType!=null)\n id = document.getElementById('insertbot').value;\n\n template = window.top.document.getElementById('template_id');\n templateid = template.value;\n\n var tag = id;\n if(id != 0)\n getContent(id, content_type, url,templateid);\n\n form.contenttag.value = tag;\n }\n //if id == null\n else\n {\n var tag = form.contentreplace.value;";
if (version_compare(JVERSION, '1.6.0', '<')) {
//1.5
$js .= " if(window.top.insertTag(tag)){window.top.document.getElementById('sbox-window').close();}";
} else {
if (version_compare(JVERSION, '3.0.0', '<')) {
$js .= ' if(window.top.insertTag(tag)) {window.parent.SqueezeBox.close();}';
} else {
$js .= 'if(window.top.insertTag(tag))
{
var need_click = jQuery(window.top.document).find("div.modal-backdrop");
if(need_click.length == 0) window.parent.SqueezeBox.close();
else jQuery(window.top.document).find("div.modal-backdrop").click();}';
}
}
$js .= "}\n }";
} else {
$js .= "\n if(changeType==null)\n form.botID.value= id;\n\n var tag = '{contentitem:' + form.botID.value + '|' + content_type +'|'+hide_title+ '}';\n\n form.contenttag.value = tag;\n }\n //if id -- null\n else\n {\n\n var tag = form.contenttag.value;";
if (version_compare(JVERSION, '1.6.0', '<')) {
//1.5
$js .= " if(window.top.insertTag(tag)){window.top.document.getElementById('sbox-window').close();}";
} else {
if (version_compare(JVERSION, '3.0.0', '<')) {
$js .= ' if(window.top.insertTag(tag)) {window.parent.SqueezeBox.close();}';
} else {
$js .= ' if(window.top.insertTag(tag)) {
var need_click = jQuery(window.top.document).find("div.modal-backdrop");
if(need_click.length == 0) window.parent.SqueezeBox.close();
else jQuery(window.top.document).find("div.modal-backdrop").click();}';
}
}
$js .= "}\n }";
}
//end function
if (version_compare(JVERSION, '1.6.0', '<')) {
//1.5
$js .= "\n\n \t\t\tfunction getContent(id, content_type, url, templateid){\n\n \t\t\t\tvar ajax = new Ajax(url,\n \t\t\t\t\t{data: 'artId='+id+'&content_type='+content_type+'&templateid='+templateid,\n \t\t\t\t\tmethod: 'POST',\n \t\t\t\t\tonComplete : function(result){insertContent(result, id); }\n \t\t\t\t\t}\n \t\t\t\t);\n \t\t\t\tajax.request();\n \t\t\t}";
} else {
$js .= "\n \t\t\tfunction getContent(id, content_type, url,templateid){\n\n\t\t\t\tvar ajax = new Request({\n\t\t\t\turl : url,\n\t\t\t\tdata: 'artId='+id+'&content_type='+content_type+'&templateid='+templateid,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tonComplete : function(result){insertContent(result, id); }\n\t\t\t\t});\n\t\t\t\tajax.send();\n \t\t\t}";
}
$js .= "\n \t\t\tfunction insertContent(html, id){\n\t\t\t\tvar form = document.adminForm;\n\t\t\t\tif(!form){\n\t\t\t\t\tform = document.mosForm;\n\t\t\t\t}\n\n\t\t\t\tvar root = document.createElement('div');\n\n\t\t\t\troot.innerHTML = html;\n\t\t\t\tvar body = document.getElementsByTagName('body')[0].appendChild(root);\n\n\t\t\t\troot.setAttribute(\"style\", \"width:150px; display:none\");\n\t\t\t\tvar element = document.getElementById('artcontent_'+id);\n\n\t\t\t\tform.contentreplace.value = element.innerHTML;\n\n\t\t\t\tdocument.getElementsByTagName('body')[0].removeChild(root);\n\t\t\t}\n\t\t\t";
$url = jNews_Tools::completeLink('option=' . JNEWS_OPTION . '&act=mailing&task=articleContent', false, false, true);
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
?>
<style type="text/css">
table.smartcontent {
border: 1px solid #D5D5D5;
background-color: #F6F6F6;
width: 100%;
margin-bottom: 10px;
-moz-border-radius:3px;
-webkit-border-radius:3px;
padding: 5px;
}
table.smartcontent td.key {
background-color: #f6f6f6;
text-align: left;
width: 140px;
color: #666;
font-weight: bold;
//.........这里部分代码省略.........
示例13: getTooltip
protected function getTooltip($currentDay, $linkattr)
{
$tooltip = "";
if (!isset($currentDay["events"]) || !is_array($currentDay["events"]) || count($currentDay["events"]) == 0) {
return $tooltip;
}
// load core and extra mootools
JHTML::_('behavior.framework');
JHtmlBehavior::framework();
JHtmlBehavior::framework(true);
foreach ($currentDay["events"] as $event) {
$link = $event->viewDetailLink($event->yup(), $event->mup(), $event->dup(), true, $this->myItemid);
//JRoute::_('index.php?option='.$jev_component_name.'&Itemid='.$this->myItemid.$this->cat.'&task=icalrepeat.detail';
$tooltip .= "<a href='" . $link . "'>" . $event->title() . "</a><br/>";
}
$tooltip .= "<hr class='jev-click-to-open'/><small class='jev-click-to-open'>" . JText::_("JEV_EVENTS_CLICK_EVENT_FOR_MORE_DETAILS", true) . "</small>";
$tipTitle = '<div class="jevtt_title" >' . JText::_("JEV_EVENTS_THIS_DAY", true) . '</div>';
$tipText = '<div class="jevtt_text">' . $tooltip . '</div>';
$tooltip = htmlspecialchars($tipTitle . $tipText, ENT_QUOTES);
$link = $this->htmlLinkCloaking($currentDay["link"], $currentDay['d'], $linkattr);
$tooltip = '<span class="editlinktip hasjevtip" title="' . $tooltip . '" >' . $link . '</span>';
static $script;
if (!isset($script)) {
$script = true;
JevHtmlBootstrap::popover('.hasjevtip', array("trigger" => "hover focus", "placement" => "top", "container" => "body", "delay" => array("hide" => 150)));
}
return $tooltip;
}
示例14: getInput
protected function getInput()
{
jimport('joomla.filesystem.folder');
$invalue = str_replace(" ", "", $this->value);
$invalue = explode(",", $invalue);
$pluginsDir = JPATH_ROOT . '/plugins/jevents';
$filterpath = $pluginsDir . "/filters";
$this->filterpath = array();
if (JFolder::exists($filterpath)) {
$this->filterpath[] = $filterpath;
}
$this->filterpath[] = JPATH_SITE . "/components/com_jevents/libraries/filters";
if (JFolder::exists(JPATH_SITE . "/plugins/jevents")) {
$others = JFolder::folders(JPATH_SITE . "/plugins/jevents", 'filters', true, true);
if (is_array($others)) {
$this->filterpath = array_merge($this->filterpath, $others);
}
}
$filters = array();
include_once JPATH_SITE . "/components/com_jevents/libraries/filters.php";
foreach ($this->filterpath as $path) {
foreach (JFolder::files($path, ".php") as $filtername) {
if (!array_key_exists($filtername, $filters)) {
if (strpos($filtername, "-") > 0 || strpos($filtername, ".zip") > 0 || strpos($filtername, ".php") != strlen($filtername) - 4) {
continue;
}
$filterpath = $path . "/" . $filtername;
$filtername = substr($filtername, 0, strlen($filtername) - 4);
// skip special function filters
if ($filtername == "startdate" || $filtername == "Startdate") {
continue;
}
$filter = "jev" . ucfirst($filtername) . "Filter";
if (!class_exists($filter)) {
include_once $filterpath;
}
if (!class_exists($filter)) {
continue;
}
$filters[$filtername] = $path . "/" . $filter;
}
}
}
$validvalues = array();
$input = '<div style="clear:left"></div><table><tr valign="top">
<td><div style="font-weight:bold">' . JText::_("JEV_CLICK_TO_ADD_FILTER") . '</div>
<div id="filterchoices" style="width:150px;margin-top:10px;height:100px;;border:solid 1px #ccc;overflow-y:auto" >';
foreach ($filters as $filter => $filterpath) {
if (!in_array($filter, $invalue) && !in_array(strtolower($filter), $invalue)) {
$input .= '<div>' . $filter . "<span style='display:none'>{$filter}</span></div>";
$validvalues[] = $filter;
}
}
$validvalue = implode(",", $validvalues);
$input .= '</div></td>
<td><div style="font-weight:bold">' . JText::_("JEV_FILTER_CLICK_TO_REMOVE") . '</div>
<div id="filtermatches" style="margin:10px 0px 0px 10px;">';
$invalues = array();
foreach ($invalue as $filter) {
if (array_key_exists($filter, $filters) || array_key_exists(ucfirst($filter), $filters)) {
$filter = ucfirst($filter);
$input .= '<div id="filter' . $filter . '">' . $filter . "</div>";
$invalues[] = $filter;
}
}
$invalues = implode(",", $invalues);
$input .= '</div></td>
</tr></table>';
// load core and extra mootools
JHTML::_('behavior.framework');
JHtmlBehavior::framework();
JHtmlBehavior::framework(true);
JEVHelper::script('modules/mod_jevents_filter/fields/filterSelect.js');
// Initialize some field attributes.
$size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
$maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : '';
$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
$readonly = (string) $this->element['readonly'] == 'true' ? ' readonly="readonly"' : '';
$disabled = (string) $this->element['disabled'] == 'true' ? ' disabled="disabled"' : '';
// Initialize JavaScript field attributes.
$onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
return $input . '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '"' . ' value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $size . $disabled . $readonly . $onchange . $maxLength . '/>';
}
示例15: assignTemplate
/**
* <p>public static function to create the view of the template list where the user can assign a template to a newsletter.</p>
* @param mixed $templates - the array object list of templates in the database
*/
public static function assignTemplate($templates, $forms, $setLimit, $templatesearch)
{
if (version_compare(JVERSION, '3.0.0', '<')) {
JHTML::_('behavior.modal');
} else {
JHtml::_('behavior.modal');
}
if (version_compare(JVERSION, '3.0.0', '<')) {
JHTML::_('behavior.mootools');
} else {
JHtmlBehavior::framework();
}
$action = JRequest::getString('act', '', 'request');
$js = "function assignTemplate(templateid){var templatebody = window.document.getElementById('templatebody_'+templateid).innerHTML;\n\t \tvar templatealtbody = window.document.getElementById('templatealtbody_'+templateid).innerHTML;\n\t \twindow.top.changeTemplate(templatebody, templatealtbody,templateid);";
if (version_compare(JVERSION, '1.6.0', '<')) {
//1.5
$js .= " window.top.document.getElementById('sbox-window').close();";
} else {
if (version_compare(JVERSION, '3.0.0', '<')) {
$js .= " window.parent.SqueezeBox.close();";
} else {
$js .= 'jQuery(window.top.document).find("div.modal-backdrop").click();';
}
}
$js .= "}";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
?>
<style type="text/css">
div#pagination {
background-color: #006699;
margin: auto;
padding: 0 8px;
color: #FFFFFF;
}
div.template-container {
border-bottom: 1px dotted #000000;
padding: 5px;
margin-top: 10px;
float: left;
width: 596px;
cursor:pointer;
}
div.template-container:hover {
background-color: #CCFFFF;
}
div.template-container div#image {
float:left;
margin-right: 5px;
}
div.template-container div#name {
clear: right;
border: 1px solid #000;
font-weight: bold;
font-size: 1.2em;
}
div.template-container div#description {
margin-top: 5px;
}
</style>
<?php
echo $forms['main'];
?>
<div id="pagination">
<?php
// for search
$limit = -1;
$hidden = '<input type="hidden" name="limit" value="' . $limit . '" />';
$toSearch = new stdClass();
//$toSearch->forms = '';
$toSearch->hidden = $hidden;
$toSearch->listsearch = $templatesearch;
$toSearch->id = 'templatesearch';
//echo jnews::setTop($toSearch, null, $setLimit, null, true);
echo jnews::setTop($toSearch, null);
?>
</div>
<?php
foreach ($templates as $countMeNow => $template) {
if ($template->availability == 1 && $template->published == 1) {
if (empty($template->thumbnail)) {
$template->thumbnail = 'sample-image.png';
}
$findposhttp = strpos($template->thumbnail, 'http://');
$findposwww = strpos($template->thumbnail, 'www.');
if ($findposhttp === false || $findposwww === false) {
$path = $template->thumbnail;
$img = '<img src="' . $path . '" alt="' . $template->name . '">';
} else {
$path = $template->thumbnail;
$img = '<img src="' . $path . '" alt="' . $template->name . '">';
//.........这里部分代码省略.........