本文整理汇总了PHP中JHTML::script方法的典型用法代码示例。如果您正苦于以下问题:PHP JHTML::script方法的具体用法?PHP JHTML::script怎么用?PHP JHTML::script使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JHTML
的用法示例。
在下文中一共展示了JHTML::script方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchElement
/**
* fetch Element
*/
function fetchElement($name, $values, &$node, $control_name)
{
$mediaPath = JURI::root() . str_replace(DS, '/', str_replace(JPATH_ROOT, '', dirname(dirname(dirname(__FILE__))))) . '/assets/';
JHTML::stylesheet('form.css', $mediaPath);
$attributes = $node->attributes();
$class = isset($attributes['group']) && trim($attributes['group']) == 'end' ? 'lof-end-group' : 'lof-group';
$title = isset($attributes['title']) ? JText::_($attributes['title']) : 'Group';
$title = isset($attributes['title']) ? JText::_($attributes['title']) : '';
$for = isset($attributes['for']) ? $attributes['for'] : '';
if (isset($attributes['onoff'])) {
// echo $control_name; die;
// echo $name; die;
// echo '<pre>'.print_r($values,1); die;
$string = '<div ' . ($title ? "" : 'style="display:none"') . ' class="' . $class . '" title="' . $for . '">';
$checked = $values ? 'checked="checked"' : "";
// echo $checked; die;
$string .= '<input type="checkbox" class="lof-onoff" id="params' . $for . '" value="" ' . $checked . ' name="' . $control_name . '[' . $for . ']" /><b>' . $title . '</b></div>';
return $string;
} else {
$string = '<div ' . ($title ? "" : 'style="display:none"') . ' class="' . $class . '" title="' . $for . '">' . $title . '</div>';
if (!defined('LOF_ADDED_TIME')) {
$string .= '<input type="hidden" class="text_area" value="' . time() . '" id="paramsmain_lof_added_time" name="params[lof_added_time]">';
define('LOF_ADDED_TIME', 1);
}
}
if (!defined('ADD_MEDIA_CONTROL')) {
define('ADD_MEDIA_CONTROL', 1);
$uri = str_replace(DS, "/", str_replace(JPATH_SITE, JURI::base(), dirname(__FILE__)));
$uri = str_replace("/administrator/", "", $uri);
JHTML::stylesheet('form.css', $uri . "/media/");
JHTML::script('form.js', $uri . "/media/");
}
return $string;
}
示例2: display
public function display($tpl = null)
{
// Page title
$this->setTitle('Updates');
// Toolbar options
JToolBarHelper::custom('refresh', 'preview.png', 'preview_f2.png', 'Refresh', false);
// Add jQuery for selection effects
MageBridgeTemplateHelper::load('jquery');
JHTML::script('media/com_magebridge/js/backend-update.js');
$update = MAGEBRIDGE_UPDATE_NOTAVAILABLE;
$component_version = null;
$data = MageBridgeUpdateHelper::getData();
foreach ($data as $index => $extension) {
if (empty($extension['latest_version'])) {
continue;
}
if ($extension['current_version'] != $extension['latest_version']) {
$update = MAGEBRIDGE_UPDATE_AVAILABLE;
break;
} else {
$update = MAGEBRIDGE_UPDATE_NOTNEEDED;
}
$data[$index] = $extension;
}
if ($update != MAGEBRIDGE_UPDATE_NOTAVAILABLE) {
JToolBarHelper::custom('update', 'download.png', 'download_f2.png', 'Update', false);
}
if ($update == MAGEBRIDGE_UPDATE_AVAILABLE) {
JError::raiseNotice('UPDATE', 'There are new updates available');
}
$this->assignRef('data', $data);
$this->assignRef('update', $update);
parent::display($tpl);
}
示例3: fetchElement
public function fetchElement($name, $value, &$node, $control_name)
{
$application = JFactory::getApplication();
$document = JFactory::getDocument();
$fieldName = $control_name . '[' . $name . ']';
$link = JURI::root() . COLOR_PICKER_URL . 'index.php?object=' . $name . '&color=' . preg_replace('/([^a-zA-Z0-9]?)/', '', $value);
JHTML::script('colorpicker.js', COLOR_PICKER_URL);
JHTML::_('behavior.modal', 'a.modal');
$title = JText::_('Select a Color');
$short_title = JText::_('Select');
$name_value = !empty($value) ? $value : $title;
$background_color = !empty($value) ? $value : '#ffffff';
$html = <<<EOF
<div style="float:left;">
<input style="background-color:#ffffff;" type="text" id="{$name}_name" value="{$name_value}" disabled="disabled" size="12" />
</div>
<div style="float:left;">
<div style="background-color: {$background_color}; width:15px; height:15px; border: 1px solid #a3a3a3; margin-left:2px" id="{$name}_preview"></div>
</div>
<div class="button2-left">
<div class="blank">
<a class="modal" title="{$title}" href="{$link}" rel="{handler:'iframe', size: {x: 450, y: 375}}">{$short_title}</a>
</div>
</div>
<input type="hidden" id="{$name}_id" name="{$fieldName}" value="{$value}" />
EOF;
return $html;
}
示例4: getInput
/**
*
* process input params
* @return string element param
*/
protected function getInput()
{
if (!defined('_JA_PARAM_HELPER')) {
define('_JA_PARAM_HELPER', 1);
$uri = str_replace(DS, "/", str_replace(JPATH_SITE, JURI::base(), dirname(__FILE__)));
$uri = str_replace("/administrator/", "", $uri);
//mootools support joomla 1.7 and 2.5
JHTML::_('behavior.framework', true);
JHTML::stylesheet($uri . '/assets/css/japaramhelper.css');
JHTML::script($uri . '/assets/js/japaramhelper.js');
}
$func = (string) $this->element['function'] ? (string) $this->element['function'] : '';
$value = $this->value ? $this->value : (string) $this->element['default'];
// var_dump($func); die;
if (substr($func, 0, 1) == '@') {
$func = substr($func, 1);
if (method_exists($this, $func)) {
return $this->{$func}();
}
} else {
$subtype = isset($this->element['subtype']) ? trim($this->element['subtype']) : '';
if (method_exists($this, $subtype)) {
return $this->{$subtype}();
}
}
return;
}
示例5: getInput
/**
* fetch Element
*/
protected function getInput()
{
if (!defined('LOF_LOADMEDIACONTROL')) {
define('LOF_LOADMEDIACONTROL', 1);
$uri = str_replace(DS, "/", str_replace(JPATH_SITE, JURI::base(), dirname(__FILE__)));
$uri = str_replace("/administrator/", "", $uri);
JHTML::stylesheet($uri . "/media/" . 'form.css');
JHTML::script($uri . "/media/" . 'form.js');
}
if ($this->title == 'end_form') {
?>
<script type="text/javascript">
var panels = $$("#module-form .pane-sliders > .panel").fade("out").removeClass("panel").addClass("lof-panel");
var div = new Element("div", {"class":"lof-wrapper"});
var container = new Element("div", {"class":"lof-container"});
container.innerHTML='<fieldset class="fs-form"><legend><?php
echo JText::_("Module Setting");
?>
</legend><div class="lof-toolbars"></div><div class="lof-fscontainer"></div></legend></fieldset>';
var _toolbar = container.getElement(".lof-toolbars");
var _container = container.getElement(".lof-fscontainer");
$$("#module-form .pane-sliders").adopt( div.adopt(container) );
new LofForm(panels, _toolbar, _container );
</script>
<?php
}
// $text = (string)$this->element['text']?(string)$this->element['text']:'';
/// return '<div class="lof-header">'.JText::_($text).'</div>';
}
示例6: display
/**
* Displays the view.
*
* @param string $tpl the template name
*
* @return void
* @since 1.0
*/
public function display($tpl = null)
{
//TODO: Need to move css/js to SetDocument
JHTML::stylesheet('media/com_newsletter/css/admin.css');
JHTML::stylesheet('media/com_newsletter/css/bounceds.css');
JHTML::script('media/com_newsletter/js/migur/js/core.js');
JHTML::script('media/com_newsletter/js/migur/js/filterpanel.js');
JHTML::script('media/com_newsletter/js/migur/js/search.js');
JHTML::script(JURI::root() . "/administrator/components/com_newsletter/views/newsletters/bounceds.js");
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
// Let's work with model 'newsletters' !
$model = $this->getModel('bounceds');
$items = $model->getItems();
$pagination = $model->getPagination();
$state = $model->getState();
$listOrder = $model->getState('list.ordering');
$listDirn = $model->getState('list.direction');
$saveOrder = $listOrder == 'a.ordering';
$this->assignRef('items', $items);
$this->assignRef('pagination', $pagination);
$this->assignRef('state', $state);
$this->assignRef('listOrder', $listOrder);
$this->assignRef('listDirn', $listDirn);
$this->assignRef('saveOrder', $saveOrder);
parent::display($tpl);
}
示例7: display
function display($tpl = null)
{
global $mainframe;
$style = $mainframe->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
$listStyle = "\n\t\t\t<ul id=\"submenu\">\n\t\t\t\t<li><a id=\"thumbs\" onclick=\"MediaManager.setViewType('thumbs')\">" . JText::_('Thumbnail View') . "</a></li>\n\t\t\t\t<li><a id=\"details\" onclick=\"MediaManager.setViewType('details')\">" . JText::_('Detail View') . "</a></li>\n\t\t\t</ul>\n\t\t";
$document =& JFactory::getDocument();
$document->setBuffer($listStyle, 'module', 'submenu');
JHTML::_('behavior.mootools');
$document->addScript('components/com_media/assets/mediamanager.js');
$document->addStyleSheet('components/com_media/assets/mediamanager.css');
JHTML::_('behavior.modal');
$document->addScriptDeclaration("\n\t\twindow.addEvent('domready', function() {\n\t\t\tdocument.preview = SqueezeBox;\n\t\t});");
JHTML::script('mootree.js');
JHTML::stylesheet('mootree.css');
JHTML::_('behavior.uploader', 'file-upload', array('onAllComplete' => 'function(){ MediaManager.refreshFrame(); }'));
$base = str_replace("\\", "/", JPATH_ROOT);
$js = "\n\t\t\tvar basepath = '" . $base . '/images' . "';\n\t\t\tvar viewstyle = '" . $style . "';\n\t\t";
$document->addScriptDeclaration($js);
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before this one if there is any file write operation
*/
jimport('joomla.client.helper');
$ftp = !JClientHelper::hasCredentials('ftp');
$this->assignRef('session', JFactory::getSession());
$this->assignRef('config', JComponentHelper::getParams('com_media'));
$this->assignRef('state', $this->get('state'));
$this->assign('require_ftp', $ftp);
$this->assign('folders_id', ' id="media-tree"');
$this->assign('folders', $this->get('folderTree'));
// Set the toolbar
$this->_setToolBar();
parent::display($tpl);
echo JHTML::_('behavior.keepalive');
}
示例8: fetchElement
public function fetchElement($name, $value, $node = null, $control_name = null)
{
if (!empty($control_name)) {
$fieldName = $control_name . '[' . $name . ']';
} else {
$fieldName = $name;
}
// Are the API widgets enabled?
if (MagebridgeModelConfig::load('api_widgets') == true) {
// Load the javascript
JHTML::script('backend-elements.js', 'media/com_magebridge/js/');
JHTML::_('behavior.modal', 'a.modal');
if (!empty($node) && is_object($node)) {
$returnType = $node->attributes('return');
} else {
if (!empty($node) && is_array($node) && !empty($node['return'])) {
$returnType = $node['return'];
} else {
$returnType = 'sku';
}
}
$title = $value;
$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
$link = 'index.php?option=com_magebridge&view=element&tmpl=component&ajax=1&type=widget&object=' . $name . '&return=' . $returnType . '&current=' . $value;
$html = '<div style="float: left;">';
$html .= '<input type="text" id="' . $name . '" name="' . $fieldName . '" value="' . $title . '" />';
$html .= '</div>';
$html .= '<div class="button2-left"><div class="blank">';
$html .= '<a class="modal" title="' . JText::_('Select a widget') . '" href="' . $link . '" rel="{handler: \'iframe\', size: {x:800, y:450}}">' . JText::_('Select') . '</a>';
$html .= '</div></div>' . "\n";
return $html;
}
return '<input type="text" name="' . $fieldName . '" value="' . $value . '" />';
}
示例9: display
function display($tpl = null)
{
global $mainframe, $option;
JHTML::script('jsn_is_imageshow.js', 'administrator/components/com_imageshow/assets/js/');
JHTML::stylesheet('imageshow.css', 'administrator/components/com_imageshow/assets/css/');
JHTML::stylesheet('mediamanager.css', 'administrator/components/com_imageshow/assets/css/');
$objJSNShowlist = JSNISFactory::getObj('classes.jsn_is_showlist');
$task = JRequest::getString('task');
if ($task != 'element' && $task != 'elements') {
$objJSNShowlist->checkShowlistLimition();
}
$list = array();
$model = $this->getModel();
$filterState = $mainframe->getUserStateFromRequest('com_imageshow.showlist.filter_state', 'filter_state', '', 'word');
$filterOrder = $mainframe->getUserStateFromRequest('com_imageshow.showlist.filter_order', 'filter_order', '', 'cmd');
$filterOrderDir = $mainframe->getUserStateFromRequest('com_imageshow.showlist.filter_order_Dir', 'filter_order_Dir', '', 'word');
$showlistTitle = $mainframe->getUserStateFromRequest('com_imageshow.showlist.showlist_stitle', 'showlist_stitle', '', 'string');
$showlistAccess = $mainframe->getUserStateFromRequest('com_imageshow.showlist.showlist_access', 'access', '', 'string');
$type = array(0 => array('value' => '', 'text' => '- Published -'), 1 => array('value' => 'P', 'text' => 'Yes'), 2 => array('value' => 'U', 'text' => 'No'));
$lists['type'] = JHTML::_('select.genericList', $type, 'filter_state', 'id="filter_state" class="inputbox" onchange="document.adminForm.submit( );"' . '', 'value', 'text', $filterState);
$lists['state'] = JHTML::_('grid.state', $filterState);
$lists['access'] = $model->accesslevel($showlistAccess);
$lists['showlistTitle'] = $showlistTitle;
$lists['order_Dir'] = $filterOrderDir;
$lists['order'] = $filterOrder;
$items =& $this->get('Data');
$total =& $this->get('Total');
$pagination =& $this->get('Pagination');
$this->assignRef('lists', $lists);
$this->assignRef('total', $total);
$this->assignRef('items', $items);
$this->assignRef('pagination', $pagination);
parent::display($tpl);
}
示例10: Edit
function Edit()
{
$id = JRequest::getInt("id");
$cfg = CustomFieldsFactory::getConfig();
$field = JTable::getInstance('FieldsTable', 'JTheFactory');
$parameters_plugins = null;
if ($id) {
if (!$field->load($id)) {
JError::raiseNotice(101, JText::_("FACTORY_ERROR_LOADING_FIELD") . " {$id}");
$this->setRedirect("index.php?option=" . APP_EXTENSION . "&task=fields.listfields");
return;
}
} else {
$field->setDefaults();
}
$lists = JTheFactoryFieldsHelper::createHTMLObjectsForField($field);
JHTML::_('behavior.mootools');
//load mootools before fields.js
JHTML::script("administrator/components/" . APP_EXTENSION . "/thefactory/fields/js/fields.js");
JHTML::stylesheet("administrator/components/" . APP_EXTENSION . "/thefactory/fields/css/fields.css");
if ($field->id && $field->categoryfilter) {
$model = JModel::getInstance('Fields', 'JTheFactoryModel');
$assigned = $model->getAssignedCats($field);
} else {
//select all by default
$assigned = "all";
}
$lists->category = JHtml::_('factorycategory.select', 'parent[]', 'style="width:200px" multiple size=10' . ($field->categoryfilter ? '' : ' disabled'), $assigned, true);
$view = $this->getView('edit');
$view->assignRef('lists', $lists);
$view->assignRef('field', $field);
$view->display();
}
示例11: init
public static function init($params = null)
{
// init path
$modulePath = 'modules/' . self::$moduleName . '/';
$path = str_replace($modulePath, "", JURI::base());
self::$path = $path . 'modules/' . self::$moduleName . '/';
if (!$params) {
jimport('joomla.application.module.helper');
$module =& JModuleHelper::getModule("mm_feedback");
$params = new JParameter($module->params);
}
// init scripts and styles
JHTML::script('jquery-1.7.1.min.js', self::$path . 'assets/js/libs/jquery/');
JHTML::script('jquery.noconflict.js', self::$path . 'assets/js/');
JHTML::script('jquery.mousewheel-3.0.6.pack.js', self::$path . 'assets/js/libs/jquery/');
JHTML::script('jquery.fancybox.js', self::$path . 'assets/js/libs/jquery/fancybox/');
JHTML::stylesheet('jquery.fancybox.css', self::$path . 'assets/js/libs/jquery/fancybox/');
JHTML::stylesheet('jquery.fancybox-buttons.css', self::$path . 'assets/js/libs/jquery/fancybox/helpers/');
JHTML::script('jquery.fancybox-buttons.js', self::$path . 'assets/js/libs/jquery/fancybox/helpers/');
JHTML::stylesheet('jquery.fancybox-thumbs.css', self::$path . 'assets/js/libs/jquery/fancybox/helpers/');
JHTML::script('jquery.fancybox-thumbs.js', self::$path . 'assets/js/libs/jquery/fancybox/helpers/');
JHTML::script('default.js', self::$path . 'assets/js/');
JHTML::stylesheet('zenbox.css', self::$path . 'assets/css/');
// init inline scripts
$doc =& JFactory::getDocument();
$result = array();
$result[] = "modMmFeedback.baseUrl = '" . JURI::base() . "'";
$result[] = "modMmFeedback.moduleName = '" . self::$moduleName . "'";
$doc->addScriptDeclaration(implode(";\n", $result) . ";");
$instance = new modMmFeedback();
$instance->params = $params;
return $instance;
}
示例12: display
function display($tpl = null)
{
JHTML::stylesheet(JoaktreeHelper::joaktreecss());
JHTML::script(JoaktreeHelper::jsfile());
// what is the layout
$this->layout = JFactory::getApplication()->input->get('layout');
// Get data from the model
if ($this->layout == 'personevent') {
$this->items =& $this->get('DataPersEvent');
$this->pagination =& $this->get('personPagination');
} else {
if ($this->layout == 'personname') {
$this->items =& $this->get('DataPersName');
$this->pagination =& $this->get('namePagination');
} else {
if ($this->layout == 'relationevent') {
$this->items =& $this->get('DataRelaEvent');
$this->pagination =& $this->get('relationPagination');
} else {
$this->items =& $this->get('DataPersEvent');
$this->pagination =& $this->get('personPagination');
}
}
}
//Filter
$context = 'com_joaktree.jt_settings.list.';
JoaktreeHelper::addSubmenu($this->layout);
$this->addToolbar($this->layout);
$this->sidebar = JHtmlSidebar::render();
$this->html = $this->getHtml();
parent::display($tpl);
}
示例13: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
static $once;
$assets = 'administrator/components/com_avreloaded/assets/';
$assetsuri = JURI::root() . 'administrator/components/com_avreloaded/assets/';
$js_mor = 'mooRainbow.js';
$cfg =& JFactory::getConfig();
$debug = $cfg->getValue('config.debug');
$konqcheck = strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "konqueror");
// If global debugging is enabled or the browser is konqueror,
// we use uncompressed JavaScript
if ($debug || $konqcheck) {
$js_mor = 'mooRainbow-uncompressed.js';
}
JHTML::script($js_mor, $assets);
JHTML::stylesheet('mooRainbow.css', $assets);
if (!$once) {
$once = true;
$js = "window.addEvent('domready', function() {\n" . " var r = new MooRainbow('none', {align:'tl',okLabel:'" . JText::_('LBL_SELECT', true) . "',wheel:true,imgPath:'" . $assetsuri . "'});\n" . " \$\$('.rainbow').each(function(el) {\n" . " el.setStyle('cursor', 'pointer');\n" . " el.addEvent('click', function(e) { new Event(e).stop(); r.reAttachAndShow(el); }.bind(r));\n" . " });\n" . "});\n";
$style = '.moor-cursor{background-image:url(' . $assetsuri . 'moor_cursor.gif);} ' . '.moor-arrows{background-image:url(' . $assetsuri . 'moor_arrows.gif);} ';
AvrGenericHelper::addJS($js);
AvrGenericHelper::addCSS($style);
}
$size = $node->attributes('size') ? 'size="' . $node->attributes('size') . '"' : '';
$class = $node->attributes('class') ? 'class="' . $node->attributes('class') . '"' : 'class="text_area"';
/*
* Required to avoid a cycle of encoding &
* html_entity_decode was used in place of htmlspecialchars_decode because
* htmlspecialchars_decode is not compatible with PHP 4
*/
$value = htmlspecialchars(html_entity_decode($value, ENT_QUOTES), ENT_QUOTES);
$elem = '<div>' . '<img src="' . $assetsuri . 'rainbow.png" class="rainbow" ' . 'style="vertical-align:middle;margin-right:5px;" rel="' . $control_name . $name . '" alt="" /><input type="text" name="' . $control_name . '[' . $name . ']" id="' . $control_name . $name . '" value="' . $value . '" ' . $class . ' ' . $size . ' /></div>';
return $elem;
}
示例14: display
function display($tpl = null)
{
/* Load required javascripts */
RaidPlannerHelper::loadJSFramework(true);
JHTML::script('com_raidplanner/HtmlTable.Extended.js', false, true);
$model = $this->getModel();
$paramsObj = JComponentHelper::getParams('com_raidplanner');
$menuitemid = JRequest::getInt('Itemid');
if ($menuitemid) {
$menu = JFactory::getApplication()->getMenu();
$menuparams = $menu->getParams($menuitemid);
$paramsObj->merge($menuparams);
}
$guild_id = $paramsObj->get('guild_id', '0');
$show_account = $paramsObj->get('show_account', '0');
$initial_sort = $paramsObj->get('initial_sort', '0');
$guild_plugin = RaidPlannerHelper::getGuildPlugin($guild_id);
if ($guild_plugin != null) {
$sync_interval = $paramsObj->get('sync_interval', 4);
$sync_enabled = $paramsObj->get('armory_sync', '0') == 1;
if ($sync_enabled) {
$guild_plugin->trigger('onRPSyncGuild', array($guild_id, $sync_interval, false));
}
$guild_plugin->trigger('onRPLoadCSS');
}
$this->assignRef('guild_plugin', $guild_plugin);
$this->assign('characters', $model->getGuildCharacters($guild_id));
$this->assign('guildinfo', $model->getGuildInfo($guild_id));
$this->assign('ranks', RaidPlannerHelper::getRanks());
$this->assignRef('show_account', $show_account);
$this->assignRef('initial_sort', $initial_sort);
parent::display($tpl);
}
示例15: __construct
function __construct()
{
JViewLegacy::__construct();
$this->smarty=new BidsSmarty();
JHtml::_('behavior.mootools');
JHTML::script(JUri::root().'components/'.APP_EXTENSION.'/js/auctions.js');
}