本文整理汇总了PHP中JHTML类的典型用法代码示例。如果您正苦于以下问题:PHP JHTML类的具体用法?PHP JHTML怎么用?PHP JHTML使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JHTML类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: fetchHead
public static function fetchHead($params, $module)
{
$document = JFactory::getDocument();
$mainframe = JFactory::getApplication();
$template = $mainframe->getTemplate();
JHTML::_('behavior.framework');
$language = JFactory::getLanguage();
$mapApi = 'http://maps.google.com/maps/api/js?sensor=true&language=' . $language->getTag();
if ($params->get('weather')) {
$mapApi .= '&libraries=weather';
}
$document->addScript($mapApi);
if (file_exists(JPATH_BASE . '/templates/' . $template . '/html/mod_bt_googlemaps/js/default.js')) {
$document->addScript(JURI::root() . 'templates/' . $template . '/html/mod_bt_googlemaps/js/default.js');
} else {
$document->addScript(JURI::root() . 'modules/mod_bt_googlemaps/tmpl/js/btbase64.min.js');
if ($params->get('enable-custom-infobox')) {
$document->addScript(JURI::root() . 'modules/mod_bt_googlemaps/tmpl/js/infobox.js');
}
$document->addScript(JURI::root() . 'modules/mod_bt_googlemaps/tmpl/js/default.js');
}
if (file_exists(JPATH_BASE . '/templates/' . $template . '/html/mod_bt_googlemaps/css/styles.css')) {
$document->addStyleSheet(JURI::root() . 'templates/' . $template . '/html/mod_bt_googlemaps/css/style.css');
} else {
$document->addStyleSheet(JURI::root() . 'modules/mod_bt_googlemaps/tmpl/css/style.css');
}
}
开发者ID:Tommar,项目名称:vino2,代码行数:27,代码来源:helper.php
示例2: 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;
}
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:37,代码来源:fgroup.php
示例3: fetchButton
function fetchButton($type = 'Acyactions')
{
$url = JURI::base() . "index.php?option=com_acymailing&ctrl=filter&tmpl=component";
$top = 0;
$left = 0;
$width = 700;
$height = 500;
$text = JText::_('ACTIONS');
if (!ACYMAILING_J30) {
$class = "icon-32-acyaction";
} else {
$class = "icon-14-acyaction";
}
$js = "\r\nfunction getAcyActionUrl() {\r\n\ti = 0;\r\n\tmylink = 'index.php?option=com_acymailing&ctrl=filter&tmpl=component&subid=';\r\n\twhile(window.document.getElementById('cb'+i)){\r\n\t\tif(window.document.getElementById('cb'+i).checked)\r\n\t\t\tmylink += window.document.getElementById('cb'+i).value+',';\r\n\t\ti++;\r\n\t}\r\n\treturn mylink;\r\n}\r\n";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
if (!ACYMAILING_J30) {
JHTML::_('behavior.modal', 'a.modal');
return '<a href="' . $url . '" class="modal" onclick="this.href=getAcyActionUrl();" rel="{handler: \'iframe\', size: {x: ' . $width . ', y: ' . $height . '}}"><span class="' . $class . '" title="' . $text . '"></span>' . $text . '</a>';
}
$html = '<button class="btn btn-small modal" data-toggle="modal" data-target="#modal-' . $type . '"><i class="' . $class . '"></i> ' . $text . '</button>';
$params['title'] = $text;
$params['url'] = '\'+getAcyActionUrl()+\'';
//$url;
$params['height'] = $height;
$params['width'] = $width;
$modalHtml = JHtml::_('bootstrap.renderModal', 'modal-' . $type, $params);
$html .= str_replace(array('id="modal-' . $type . '"'), array('id="modal-' . $type . '" style="width:' . ($width + 20) . 'px;height:' . ($height + 90) . 'px;margin-left:-' . ($width + 20) / 2 . 'px"'), $modalHtml);
$html .= '<script>' . "\r\n" . 'jQuery(document).ready(function(){jQuery("#modal-' . $type . '").appendTo(jQuery(document.body));});' . "\r\n" . '</script>';
return $html;
}
开发者ID:freaqzilla,项目名称:joomla-site,代码行数:31,代码来源:acyactions.php
示例4: getHeader
/**
* Get the header
*
* @return string The header HTML
*/
protected function getHeader()
{
$sortable = $this->element['sortable'] != 'false';
$view = $this->form->getView();
$model = $this->form->getModel();
$hasAjaxOrderingSupport = $view->hasAjaxOrderingSupport();
if (!$sortable) {
// Non sortable?! I'm not sure why you'd want that, but if you insist...
return JText::_('JGRID_HEADING_ORDERING');
}
if (!$hasAjaxOrderingSupport) {
// Ye olde Joomla! 2.5 method
$html = JHTML::_('grid.sort', 'JFIELD_ORDERING_LABEL', 'ordering', $view->getLists()->order_Dir, $view->getLists()->order, 'browse');
$html .= JHTML::_('grid.order', $model->getList());
return $html;
} else {
// The new, drag'n'drop ordering support WITH a save order button
$html = JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $view->getLists()->order_Dir, $view->getLists()->order, null, 'asc', 'JGRID_HEADING_ORDERING');
$ordering = $view->getLists()->order == 'ordering';
if ($ordering) {
$html .= '<a href="javascript:saveorder(' . (count($model->getList()) - 1) . ', \'saveorder\')" ' . 'rel="tooltip" class="save-order btn btn-micro pull-right" title="' . JText::_('JLIB_HTML_SAVE_ORDER') . '">' . '<span class="icon-ok"></span></a>';
}
return $html;
}
}
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:30,代码来源:ordering.php
示例5: export
function export()
{
global $mainframe;
$model = $this->getModel('attendees');
$datas = $model->getData();
header('Content-Type: text/x-csv');
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Disposition: attachment; filename=attendees.csv');
header('Pragma: no-cache');
$k = 0;
$export = '';
$col = array();
for ($i = 0, $n = count($datas); $i < $n; $i++) {
$data =& $datas[$i];
$col[] = str_replace("\"", "\"\"", $data->name);
$col[] = str_replace("\"", "\"\"", $data->username);
$col[] = str_replace("\"", "\"\"", $data->email);
$col[] = str_replace("\"", "\"\"", JHTML::Date($data->uregdate, JText::_('DATE_FORMAT_LC2')));
$col[] = str_replace("\"", "\"\"", $data->uid);
for ($j = 0; $j < count($col); $j++) {
$export .= "\"" . $col[$j] . "\"";
if ($j != count($col) - 1) {
$export .= ";";
}
}
$export .= "\r\n";
$col = '';
$k = 1 - $k;
}
echo $export;
$mainframe->close();
}
开发者ID:reeleis,项目名称:ohiocitycycles,代码行数:32,代码来源:attendees.php
示例6: edit
function edit()
{
$country_id = JRequest::getInt("country_id");
$countries = $this->getModel("countries");
$country = JTable::getInstance('country', 'jshop');
$country->load($country_id);
$first[] = JHTML::_('select.option', '0', _JSHOP_ORDERING_FIRST, 'ordering', 'name');
$rows = array_merge($first, $countries->getAllCountries(0));
$lists['order_countries'] = JHTML::_('select.genericlist', $rows, 'ordering', 'class="inputbox" size="1"', 'ordering', 'name', $country->ordering);
$_lang = $this->getModel("languages");
$languages = $_lang->getAllLanguages(1);
$multilang = count($languages) > 1;
$edit = $country_id ? $edit = 1 : ($edit = 0);
JFilterOutput::objectHTMLSafe($country, ENT_QUOTES);
$view = $this->getView("countries", 'html');
$view->setLayout("edit");
$view->assign('country', $country);
$view->assign('lists', $lists);
$view->assign('edit', $edit);
$view->assign('languages', $languages);
$view->assign('etemplatevar', '');
$view->assign('multilang', $multilang);
JPluginHelper::importPlugin('jshoppingadmin');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeEditCountries', array(&$view));
$view->displayEdit();
}
开发者ID:ngogiangthanh,项目名称:damtvnewversion,代码行数:27,代码来源:countries.php
示例7: getFolderList
/**
* Image Manager Popup
*
* @param string $listFolder The image directory to display
* @since 1.5
*/
function getFolderList($base = null)
{
global $mainframe;
// Get some paths from the request
if (empty($base)) {
$base = JA_WORKING_DATA_FOLDER;
}
// Get the list of folders
jimport('joomla.filesystem.folder');
$folders = JFolder::folders($base, '.', 4, true);
// Load appropriate language files
$lang =& JFactory::getLanguage();
$lang->load(JRequest::getCmd('option'), JPATH_ADMINISTRATOR);
$document =& JFactory::getDocument();
$document->setTitle(JText::_('Insert Image'));
// Build the array of select options for the folder list
$options[] = JHTML::_('select.option', "", "/");
foreach ($folders as $folder) {
$folder = str_replace(JA_WORKING_DATA_FOLDER, "", $folder);
$value = substr($folder, 1);
$text = str_replace(DS, "/", $folder);
$options[] = JHTML::_('select.option', $value, $text);
}
// Sort the folder list array
if (is_array($options)) {
sort($options);
}
// Create the drop-down folder select list
$list = JHTML::_('select.genericlist', $options, 'folderlist', "class=\"inputbox\" size=\"1\" onchange=\"ImageManager.setFolder(this.options[this.selectedIndex].value)\" ", 'value', 'text', $base);
return $list;
}
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:37,代码来源:repo.php
示例8: display
function display($tpl = null)
{
global $mainframe, $option;
$cid = JRequest::getVar('cid_user');
if (!is_array($cid)) {
$mainframe->redirect('index.php?option=' . $option);
return;
}
$user_id = $cid[0];
$model = $this->getModel('user');
$model->load($user_id);
$this->_setToolBar();
$say = JText::sprintf('USER_RESOURCES_TITLE', $model->user->username);
$root_node = JText::_('RESOURCES_TREE_ROOT_NODE');
$nowdate = JFactory::getDate();
$str_now = JHTML::_('date', $nowdate->toMySQL(), '%Y-%m-%d %H:%M:%S');
$this->assign('nowdate', $str_now);
$this->assign('say', $say);
$this->assign('root_node', $root_node);
$this->assignRef('uid', $user_id);
$this->assignRef('option', $option);
//hide the menu
JRequest::setVar('hidemainmenu', 1);
parent::display();
}
开发者ID:laiello,项目名称:yrm,代码行数:25,代码来源:view.resources.php
示例9: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
// init vars
$class = $node->attributes('class') ? 'class="' . $node->attributes('class') . '"' : 'class="inputbox"';
$constraint = $node->attributes('constraint');
// get renderer
$this->renderer = new ItemRenderer();
$this->renderer->addPath($this->_parent->layout_path);
// if selectable types isn't specified, get all types
if (empty($this->_parent->selectable_types)) {
$this->_parent->selectable_types = array('');
foreach (JFolder::folders($this->_parent->layout_path . '/' . $this->renderer->getFolder() . '/item') as $folder) {
$this->_parent->selectable_types[] = $folder;
}
}
// get layouts
$layouts = array();
foreach ($this->_parent->selectable_types as $type) {
$layouts = array_merge($layouts, $this->_getLayouts($type, $constraint));
}
// create layout options
$options = array(JHTML::_('select.option', '', JText::_('Item Name')));
foreach ($layouts as $layout => $layout_name) {
$text = $layout_name;
$val = $layout;
$options[] = JHTML::_('select.option', $val, JText::_($text));
}
return JHTML::_('select.genericlist', $options, $control_name . '[' . $name . ']', $class, 'value', 'text', $value, $control_name . $name);
}
开发者ID:bizanto,项目名称:Hooked,代码行数:29,代码来源:zoolayout.php
示例10: display
function display($tpl = null)
{
//initialise variables
$document =& JFactory::getDocument();
$db =& JFactory::getDBO();
$app =& JFactory::getApplication();
JHTML::_('behavior.tooltip');
JHTML::_('behavior.modal');
//get vars
$filter_order = $app->getUserStateFromRequest('com_eventlist.categoryelement.filter_order', 'filter_order', 'c.ordering', 'cmd');
$filter_order_Dir = $app->getUserStateFromRequest('com_eventlist.categoryelement.filter_order_Dir', 'filter_order_Dir', '', 'word');
$filter_state = $app->getUserStateFromRequest('com_eventlist.categoryelement.filter_state', 'filter_state', '*', 'word');
$search = $app->getUserStateFromRequest('com_eventlist.categoryelement.search', 'search', '', 'string');
$search = $db->getEscaped(trim(JString::strtolower($search)));
$template = $app->getTemplate();
//prepare document
$document->setTitle(JText::_('SELECT CATEGORY'));
$document->addStyleSheet('templates/' . $template . '/css/general.css');
$document->addStyleSheet('components/com_eventlist/assets/css/eventlistbackend.css');
// Get data from the model
$rows =& $this->get('Data');
$pageNav =& $this->get('Pagination');
//publish unpublished filter
$lists['state'] = JHTML::_('grid.state', $filter_state);
// table ordering
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
// search filter
$lists['search'] = $search;
//assign data to template
$this->assignRef('lists', $lists);
$this->assignRef('rows', $rows);
$this->assignRef('pageNav', $pageNav);
parent::display($tpl);
}
开发者ID:julienV,项目名称:testrepo,代码行数:35,代码来源:view.html.php
示例11: display
public function display($tpl = null)
{
JToolBarHelper::title(JText::_('COM_REDSHOP_GIFTCARD_MANAGEMENT'), 'redshop_giftcard_48');
$uri = JFactory::getURI();
jimport('joomla.html.pane');
$pane = JPane::getInstance('sliders');
$this->pane = $pane;
$this->setLayout('default');
$lists = array();
$detail = $this->get('data');
$isNew = $detail->giftcard_id < 1;
$text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT');
JToolBarHelper::title(JText::_('COM_REDSHOP_GIFTCARDS') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_giftcard_48');
JToolBarHelper::apply();
JToolBarHelper::save();
if ($isNew) {
JToolBarHelper::cancel();
} else {
JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE'));
}
$lists['customer_amount'] = JHTML::_('select.booleanlist', 'customer_amount', 'class="inputbox" ', $detail->customer_amount);
$lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $detail->published);
if (ECONOMIC_INTEGRATION == 1) {
$redhelper = new redhelper();
$accountgroup = $redhelper->getEconomicAccountGroup();
$op = array();
$op[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_SELECT'));
$accountgroup = array_merge($op, $accountgroup);
$lists["accountgroup_id"] = JHTML::_('select.genericlist', $accountgroup, 'accountgroup_id', 'class="inputbox" size="1" ', 'value', 'text', $detail->accountgroup_id);
}
$this->lists = $lists;
$this->detail = $detail;
$this->request_url = $uri->toString();
parent::display($tpl);
}
开发者ID:,项目名称:,代码行数:35,代码来源:
示例12: 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;
}
开发者ID:renekreijveld,项目名称:SimpleLists,代码行数:28,代码来源:colorpicker.php
示例13: display
function display($tpl = null)
{
$entry = $this->get('Data');
$characters_length = $this->get('CharactersLength');
$robots_array = array('', 'index, follow', 'noindex, follow', 'index, nofollow', 'noindex, nofollow');
if (empty($entry->id)) {
JToolBarHelper::title(JText::_('COM_EASYFRONTENDSEO') . ' - ' . JText::_('COM_EASYFRONTENDSEO_NEWENTRY'), 'easyfrontendseo-add');
JToolBarHelper::save('save');
JToolBarHelper::cancel('cancel');
} else {
JToolBarHelper::title(JText::_('COM_EASYFRONTENDSEO') . ' - ' . JText::_('COM_EASYFRONTENDSEO_EDITENTRY'), 'easyfrontendseo-edit');
JToolbarHelper::apply('apply');
JToolBarHelper::save('save');
JToolBarHelper::cancel('cancel', 'Close');
}
JHTML::_('behavior.framework');
$document = JFactory::getDocument();
$document->addStyleSheet('components/com_easyfrontendseo/css/easyfrontendseo.css');
$document->addScript('components/com_easyfrontendseo/js/wordcount.js', 'text/javascript');
$output = "window.addEvent('domready', function(){";
$output .= "new WordCount('counter_title', {inputName:'title', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_title', {inputName:'title', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= "new WordCount('counter_description', {inputName:'description', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_description', {inputName:'description', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= "new WordCount('counter_keywords', {inputName:'keywords', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_keywords', {inputName:'keywords', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= "new WordCount('counter_generator', {inputName:'generator', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_generator', {inputName:'generator', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= " });";
$document->addScriptDeclaration($output, 'text/javascript');
$this->entry = $entry;
$this->characters_length = $characters_length;
$this->robots_array = $robots_array;
// Get donation code message
require_once JPATH_COMPONENT . '/helpers/easyfrontendseo.php';
$donation_code_message = EasyFrontendSeoHelper::getDonationCodeMessage();
$this->donation_code_message = $donation_code_message;
parent::display($tpl);
}
开发者ID:kJluk,项目名称:EFSEO-Easy-Frontend-SEO,代码行数:35,代码来源:view.html.php
示例14: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
$language = JFactory::getLanguage();
// create a unique id
$id = preg_replace('#([^a-z0-9_-]+)#i', '', $control_name . 'filesystem' . $name);
// add javascript if element has parameters
if ($node->attributes('parameters')) {
$document = JFactory::getDocument();
$document->addScriptDeclaration('$jce.Parameter.add("#' . $id . '", "filesystem");');
}
// path to directory
$path = WF_EDITOR_EXTENSIONS . DS . 'filesystem';
$filter = '\\.xml$';
$files = JFolder::files($path, $filter, false, true);
$options = array();
if (!$node->attributes('exclude_default')) {
$options[] = JHTML::_('select.option', '', WFText::_('WF_OPTION_NOT_SET'));
}
if (is_array($files)) {
foreach ($files as $file) {
// load language file
$language->load('com_jce_filesystem_' . basename($file, '.xml'), JPATH_SITE);
$xml = JApplicationHelper::parseXMLInstallFile($file);
$options[] = JHTML::_('select.option', basename($file, '.xml'), WFText::_($xml['name']));
}
}
return JHTML::_('select.genericlist', $options, '' . $control_name . '[filesystem][' . $name . ']', 'class="inputbox"', 'value', 'text', $value, $id);
}
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:30,代码来源:filesystem.php
示例15: display
function display($tpl = null)
{
$prod =& $this->get('Data');
$isNew = $prod->id < 1;
$text = $isNew ? JText::_("NEW") : JText::_("EDIT");
JToolBarHelper::title(JText::_("PRODUCT") . ': <small><small>[ ' . $text . ' ]</small></small>', 'fst_prods');
if (FST_Helper::Is16()) {
JToolBarHelper::custom('translate', 'translate', 'translate', 'Translate', false);
JToolBarHelper::spacer();
}
JToolBarHelper::save();
if ($isNew) {
JToolBarHelper::cancel();
} else {
// for existing items the button is renamed `close`
JToolBarHelper::cancel('cancel', 'Close');
}
FSTAdminHelper::DoSubToolbar();
$this->assignRef('prod', $prod);
$path = JPATH_SITE . DS . 'images' . DS . 'fst' . DS . 'products';
if (!file_exists($path)) {
mkdir($path, 0777, true);
}
$files = JFolder::files($path, '(.png$|.jpg$|.jpeg$|.gif$)');
$sections[] = JHTML::_('select.option', '', JText::_("NO_IMAGE"), 'id', 'title');
foreach ($files as $file) {
$sections[] = JHTML::_('select.option', $file, $file, 'id', 'title');
}
$lists['images'] = JHTML::_('select.genericlist', $sections, 'image', 'class="inputbox" size="1" ', 'id', 'title', $prod->image);
$this->assignRef('lists', $lists);
parent::display($tpl);
}
开发者ID:AxelFG,项目名称:ckbran-inf,代码行数:32,代码来源:view.html.php
示例16: getScript
public function getScript($block, $element, $url = null)
{
// Set the default AJAX-URL
if (empty($url)) {
$url = self::getUrl($block);
}
// Load ProtoType
if (MageBridgeTemplateHelper::hasPrototypeJs() == true) {
$script = "Event.observe(window,'load',function(){new Ajax.Updater('{$element}','{$url}',{method:'get'});});";
// Load jQuery
} else {
if (JFactory::getApplication()->get('jquery') == true) {
$script = "jQuery(document).ready(function(){\n" . " jQuery('#" . $element . "').load('" . $url . "');" . "});\n";
// Load MooTools (Joomla!)
} else {
if (MageBridgeHelper::isJoomla15()) {
JHTML::_('behavior.mootools');
$script = "window.addEvent('domready', function(){\n" . " var MBajax = new Ajax( '" . $url . "', {onSuccess: function(r){\n" . " \$('" . $element . "').innerHTML = r;\n" . " }});\n" . " MBajax.request();\n" . "});\n";
// Load MooTools (Joomla! 1.6)
} else {
JHTML::_('behavior.mootools');
$script = "window.addEvent('domready', function(){\n" . " var MBajax = new Request({\n" . " url: '" . $url . "', \n" . " onComplete: function(r){\n" . " \$('" . $element . "').innerHTML = r;\n" . " }\n" . " }).send();\n" . "});\n";
}
}
}
return $script;
}
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:27,代码来源:ajax.php
示例17: __construct
public function __construct(&$subject, $config)
{
JHTML::_('behavior.keepalive');
// Keep session
parent::__construct($subject, $config);
$this->loadLanguage();
}
开发者ID:kidaa30,项目名称:lojinha,代码行数:7,代码来源:djreviews.php
示例18: getInput
function getInput($name, $id, $value, $params, $children, $j15 = 0)
{
$this->params = $params;
JHTML::_('behavior.modal', 'a.modal');
$_size = $this->def('size');
$_multiple = $this->def('multiple', 1);
$_doc =& JFactory::getDocument();
$_js = "\n\t\t\tfunction jSelectArticle( id, title, object )\n\t\t\t{\n\t\t\t\tif ( document.getElementById(object+'_name') ) {\n\t\t\t\t\tdocument.getElementById(object+'_id').value = id;\n\t\t\t\t\tdocument.getElementById(object+'_name').value = title;\n\t\t\t\t} else {\n\t\t\t\t\t// multiple\n\t\t\t\t\tdocument.getElementById(object+'_id').value = document.getElementById(object+'_id').value.trim();\n\t\t\t\t\tif ( document.getElementById(object+'_id').value ) {\n\t\t\t\t\t\t document.getElementById(object+'_id').value += ',';\n\t\t\t\t\t}\n\t\t\t\t\tdocument.getElementById(object+'_id').value += id;\n\t\t\t\t}\n\t\t\t\tdocument.getElementById('sbox-window').close();\n\t\t\t}";
$_doc->addScriptDeclaration($_js);
$_link = 'index.php?option=com_content&task=element&tmpl=component&object=' . $id;
$html = "\n" . '<div style="float: left;">';
if (!$_multiple) {
$val_name = $value;
if ($value) {
$db =& JFactory::getDBO();
// load the list of menu types
$query = 'SELECT title' . ' FROM #__content' . ' WHERE id = ' . $value . ' LIMIT 1';
$db->setQuery($query);
$val_name = $db->loadResult();
$val_name .= ' [' . $value . ']';
}
$html .= '<input type="text" id="' . $id . '_name" value="' . $val_name . '" class="inputbox" size="' . $_size . '" disabled="disabled" />';
$html .= '<input type="hidden" name="' . $name . '" id="' . $id . '_id" value="' . $value . '" />';
} else {
$html .= '<input type="text" name="' . $name . '" id="' . $id . '_id" value="' . $value . '" class="inputbox" size="' . $_size . '" />';
}
$html .= '</div>';
$html .= '<div class="button2-left"><div class="blank"><a class="modal" title="' . JText::_('NN_SELECT_AN_ARTICLE') . '" href="' . $_link . '" rel="{handler: \'iframe\', size: {x: 650, y: 375}}">' . JText::_('NN_SELECT') . '</a></div></div>' . "\n";
return $html;
}
开发者ID:jtresca,项目名称:nysurveyor,代码行数:30,代码来源:articles.php
示例19: getOptions
public function getOptions()
{
// Must load admin language files
$lang = JFactory::getLanguage();
$lang->load("com_jevents", JPATH_ADMINISTRATOR);
$views = array();
include_once JPATH_ADMINISTRATOR . "/components/com_jevents/jevents.defines.php";
$exceptions_values = (string) $this->element['except'] ? (string) $this->element['except'] : "";
$exceptions = array();
$exceptions = explode(',', $exceptions_values);
foreach (JEV_CommonFunctions::getJEventsViewList((string) $this->element["viewtype"]) as $viewfile) {
if (in_array($viewfile, $exceptions)) {
continue;
}
$views[] = JHTML::_('select.option', $viewfile, $viewfile);
}
sort($views);
if ($this->menu != 'hide') {
$task = JRequest::getVar('task');
if ($task == "params.edit") {
unset($views['global']);
} else {
array_unshift($views, JHTML::_('select.option', 'global', JText::_('USE_GLOBAL')));
}
}
return $views;
}
开发者ID:hriggs,项目名称:cs-website,代码行数:27,代码来源:jevview.php
示例20: getMessage
function getMessage($extension = '', $xml = '', $version = '', $addmargin = 0)
{
if (!$extension || !$xml && !$version) {
return;
}
$alias = preg_replace('#[^a-z\\-]#', '', str_replace('?', '-', strtolower($extension)));
if ($xml) {
$xml = JApplicationHelper::parseXMLInstallFile(JPATH_SITE . DS . str_replace('/', DS, $xml));
if ($xml && isset($xml['version'])) {
$version = $xml['version'];
}
}
if (!$version) {
return;
}
JHTML::_('behavior.mootools');
$document =& JFactory::getDocument();
$document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/js/script.js?v=' . $this->_version);
$url = 'http://www.nonumber.nl/ext/version.php?ext=' . $alias . '&version=' . $version;
$script = "\n\t\t\twindow.addEvent( 'domready', function() {\n\t\t\t\tnnScripts.loadajax(\n\t\t\t\t\t'" . $url . "',\n\t\t\t\t\t'nnScripts.displayVersion( \\'" . $alias . "\\', data )',\n\t\t\t\t\t'nnScripts.displayVersion( \\'" . $alias . "\\', \\'\\' )'\n\t\t\t\t);\n\t\t\t});\n\t\t";
$document->addScriptDeclaration($script);
$msg = html_entity_decode(JText::sprintf('NN_A_NEWER_VERSION_IS_AVAILABLE', 'http://www.nonumber.nl/' . $alias . '/download', '<span id="nonumber_newversionnumber_' . $alias . '"></span>', $version), ENT_COMPAT, 'UTF-8');
$margin = $addmargin ? '10px;' : '3px;';
$msg = '<div style="border:3px solid #F0DC7E;color:#CC0000;margin-bottom:' . $margin . '"><div style="padding: 2px 5px;background-color:#EFE7B8">' . $msg . '</div></div>';
$msg = '<div id="nonumber_version_' . $alias . '" style="display: none;">' . $msg . '</div>';
return $msg;
}
开发者ID:jtresca,项目名称:nysurveyor,代码行数:27,代码来源:versions.php
注:本文中的JHTML类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论