本文整理汇总了PHP中JHtml类的典型用法代码示例。如果您正苦于以下问题:PHP JHtml类的具体用法?PHP JHtml怎么用?PHP JHtml使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JHtml类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getInput
public function getInput()
{
jimport('joomla.filesystem.file');
$mainframe = JFactory::getApplication();
if (!JFile::exists(JPATH_ADMINISTRATOR . '/components/com_joomailermailchimpintegration/libraries/MCAPI.class.php')) {
$mainframe->enqueueMessage(JText::_('JM_PLEASE_INSTALL_JOOMLAMAILER'), 'error');
$mainframe->redirect('index.php');
}
$listId = $this->form->getValue('listid', 'params');
require_once JPATH_ADMINISTRATOR . '/components/com_joomailermailchimpintegration/libraries/MCAPI.class.php';
$params = JComponentHelper::getParams('com_joomailermailchimpintegration');
$MCapi = $params->get('params.MCapi');
$api = new joomlamailerMCAPI($MCapi);
$interests = $api->listInterestGroupings($listId);
$options = array();
if ($interests) {
foreach ($interests as $interest) {
if ($interest['form_field'] != 'hidden') {
$groups = array();
foreach ($interest['groups'] as $ig) {
$groups[] = $ig['name'];
}
$groups = implode('####', $groups);
$options[] = array('id' => $interest['id'] . ';' . $interest['form_field'] . ';' . $interest['name'] . ';' . $groups, 'name' => $interest['name']);
}
}
}
if (count($options)) {
return JHtml::_('select.genericlist', $options, 'jform[params][interests][]', 'multiple="multiple"', 'id', 'name', $this->value, $this->id);
} else {
return JText::_('JM_NO_INTEREST_GROUPS');
}
}
开发者ID:rodhoff,项目名称:MNW,代码行数:33,代码来源:interests.php
示例2: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
JHtml::stylesheet('nnframework/style.min.css', false, true);
$title = $this->get('label');
$description = $this->get('description');
$class = $this->get('class');
$showclose = $this->get('showclose', 0);
$start = $this->get('start', 0);
$end = $this->get('end', 0);
$html = array();
if ($start || !$end) {
$html[] = '</div>';
if (strpos($class, 'alert') !== false) {
$html[] = '<div class="alert ' . $class . '">';
} else {
$html[] = '<div class="well well-small ' . $class . '">';
}
if ($showclose && JFactory::getUser()->authorise('core.admin')) {
$html[] = '<button type="button" class="close nn_remove_assignment">×</button>';
}
if ($title) {
$html[] = '<h4>' . $this->prepareText($title) . '</h4>';
}
if ($description) {
$html[] = '<div>' . $this->prepareText($description) . '</div>';
}
$html[] = '<div><div>';
}
if (!$start && !$end) {
$html[] = '</div>';
}
return '</div>' . implode('', $html);
}
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:34,代码来源:block.php
示例3: 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
示例4: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
// Initialise variables.
$html = array();
$recordId = (int) $this->form->getValue('id');
$size = ($v = $this->element['size']) ? ' size="' . $v . '"' : '';
$class = ($v = $this->element['class']) ? ' class="' . $v . '"' : 'class="text_area"';
// Get a reverse lookup of the base link URL to Title
$model = JModel::getInstance('menutypes', 'menusModel');
$rlu = $model->getReverseLookup();
switch ($this->value) {
case 'url':
$value = JText::_('COM_MENUS_TYPE_EXTERNAL_URL');
break;
case 'alias':
$value = JText::_('COM_MENUS_TYPE_ALIAS');
break;
case 'separator':
$value = JText::_('COM_MENUS_TYPE_SEPARATOR');
break;
default:
$link = $this->form->getValue('link');
// Clean the link back to the option, view and layout
$value = JText::_(JArrayHelper::getValue($rlu, MenusHelper::getLinkKey($link)));
break;
}
// Load the javascript and css
JHtml::_('behavior.framework');
JHtml::_('behavior.modal');
$html[] = '<input type="text" readonly="readonly" disabled="disabled" value="' . $value . '"' . $size . $class . ' />';
$html[] = '<input type="button" value="' . JText::_('JSELECT') . '" onclick="SqueezeBox.fromElement(this, {handler:\'iframe\', size: {x: 600, y: 450}, url:\'' . JRoute::_('index.php?option=com_menus&view=menutypes&tmpl=component&recordId=' . $recordId) . '\'})" />';
$html[] = '<input type="hidden" name="' . $this->name . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" />';
return implode("\n", $html);
}
开发者ID:laiello,项目名称:senluonirvana,代码行数:40,代码来源:menutype.php
示例5: display
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a Error object.
*/
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as &$item) {
$this->ordering[$item->parent_id][] = $item->id;
}
// Levels filter.
$options = array();
$options[] = JHtml::_('select.option', '1', JText::_('J1'));
$options[] = JHtml::_('select.option', '2', JText::_('J2'));
$options[] = JHtml::_('select.option', '3', JText::_('J3'));
$options[] = JHtml::_('select.option', '4', JText::_('J4'));
$options[] = JHtml::_('select.option', '5', JText::_('J5'));
$options[] = JHtml::_('select.option', '6', JText::_('J6'));
$options[] = JHtml::_('select.option', '7', JText::_('J7'));
$options[] = JHtml::_('select.option', '8', JText::_('J8'));
$options[] = JHtml::_('select.option', '9', JText::_('J9'));
$options[] = JHtml::_('select.option', '10', JText::_('J10'));
$this->f_levels = $options;
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') {
$this->addToolbar();
}
parent::display($tpl);
}
开发者ID:SysBind,项目名称:joomla-cms,代码行数:42,代码来源:view.html.php
示例6: getLanguageList
/**
* Get an HTML select list of the available languages.
*
* @return string
*/
public static function getLanguageList()
{
$languages = array();
$languages = JLanguageHelper::createLanguageList(null, JPATH_ADMINISTRATOR, false, true);
array_unshift($languages, JHtml::_('select.option', '', JText::_('JDEFAULT')));
return JHtml::_('select.genericlist', $languages, 'lang', ' class="inputbox"', 'value', 'text', null);
}
开发者ID:NavaINT1876,项目名称:ccustoms,代码行数:12,代码来源:helper.php
示例7: getOptions
/**
* Create objects for the options
*
* @return array The array of option objects
*/
protected function getOptions()
{
$options = array();
// Initialize some field attributes.
$key = $this->element['key_field'] ? (string) $this->element['key_field'] : 'value';
$value = $this->element['value_field'] ? (string) $this->element['value_field'] : (string) $this->element['name'];
$translate = $this->element['translate'] ? (string) $this->element['translate'] : false;
$query = (string) $this->element['query'];
// Get the database object.
$db = F0FPlatform::getInstance()->getDbo();
// Set the query and get the result list.
$db->setQuery($query);
$items = $db->loadObjectlist();
// Build the field options.
if (!empty($items)) {
foreach ($items as $item) {
if ($translate == true) {
$options[] = JHtml::_('select.option', $item->{$key}, JText::_($item->{$value}));
} else {
$options[] = JHtml::_('select.option', $item->{$key}, $item->{$value});
}
}
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
开发者ID:WineWorld,项目名称:joomlatrialcmbg,代码行数:32,代码来源:fieldsql.php
示例8: addToolbar
/**
* Method to configure the toolbar for this view.
*
* @return void
*
* @since 2.5
*/
protected function addToolbar()
{
$canDo = JHelperContent::getActions('com_finder');
JToolbarHelper::title(JText::_('COM_FINDER_MAPS_TOOLBAR_TITLE'), 'zoom-in finder');
$toolbar = JToolbar::getInstance('toolbar');
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publishList('maps.publish');
JToolbarHelper::unpublishList('maps.unpublish');
JToolbarHelper::divider();
}
if ($canDo->get('core.admin') || $canDo->get('core.options')) {
JToolbarHelper::preferences('com_finder');
}
JToolbarHelper::divider();
$toolbar->appendButton('Popup', 'bars', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350);
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_CONTENT_MAPS');
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'maps.delete');
JToolbarHelper::divider();
}
JHtmlSidebar::setAction('index.php?option=com_finder&view=maps');
JHtmlSidebar::addFilter('', 'filter_branch', JHtml::_('select.options', JHtml::_('finder.mapslist'), 'value', 'text', $this->state->get('filter.branch')), true);
JHtmlSidebar::addFilter(JText::_('COM_FINDER_INDEX_FILTER_BY_STATE'), 'filter_state', JHtml::_('select.options', JHtml::_('finder.statelist'), 'value', 'text', $this->state->get('filter.state')));
}
开发者ID:educakanchay,项目名称:educared,代码行数:32,代码来源:view.html.php
示例9: 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
示例10: getOptions
protected function getOptions()
{
// Initialize variables.
$options = array();
foreach ($this->element->children() as $option) {
// Only add <option /> elements.
if ($option->getName() != 'option') {
continue;
}
$disabled = (string) $option['disabled'];
$disabled = $disabled == 'true' || $disabled == 'disabled' || $disabled == '1';
// Create a new option object based on the <option /> element.
$tmp = JHtml::_('select.option', (string) $option['value'], trim((string) $option), 'value', 'text', $disabled);
// Set some option attributes.
$tmp->class = (string) $option['class'];
// Set some JavaScript option attributes.
$tmp->onclick = (string) $option['onclick'];
$tmp->onchange = (string) $option['onchange'];
$tmp->image = '';
if (isset($option['imagesrc'])) {
$tmp->image = (string) $option['imagesrc'];
}
$tmp->icon = '';
if (isset($option['icon'])) {
$tmp->icon = (string) $option['icon'];
}
// Add the option object to the result set.
$options[] = $tmp;
}
reset($options);
return $options;
}
开发者ID:esorone,项目名称:efcpw,代码行数:32,代码来源:imageradio.php
示例11: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
if (!is_array($this->value)) {
$this->value = explode(',', $this->value);
}
$group = $this->get('group', 'countries');
$options = array();
foreach ($this->{$group} as $key => $val) {
if (!$val) {
$options[] = JHtml::_('select.option', '-', ' ', 'value', 'text', true);
} else {
if ($key['0'] == '-') {
$options[] = JHtml::_('select.option', '-', $val, 'value', 'text', true);
} else {
$val = nnText::prepareSelectItem($val);
$options[] = JHtml::_('select.option', $key, $val);
}
}
}
$size = (int) $this->get('size');
$multiple = $this->get('multiple');
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return nnHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, $multiple);
}
开发者ID:naka211,项目名称:studiekorrektur,代码行数:25,代码来源:geo.php
示例12: getInput
protected function getInput()
{
$html = '';
$db = JFactory::getDbo();
$options = JUDownloadHelper::getFieldGroupOptions();
if ($this->element['usenone'] == 'true') {
array_unshift($options, array('value' => '0', 'text' => JText::_('COM_JUDOWNLOAD_NONE')));
}
if ($this->element['useinherit'] == 'true') {
$appendInherit = "";
if ($this->form->getValue("id")) {
$appendInherit = " ( " . JText::_('COM_JUDOWNLOAD_NONE') . " )";
if ($this->form->getValue("id") > 0) {
$catObj = JUDownloadHelper::getCategoryById($this->form->getValue("parent_id"));
if ($catObj->fieldgroup_id > 1) {
$query = "SELECT name, published FROM #__judownload_fields_groups WHERE id = " . (int) $catObj->fieldgroup_id . " AND id != 1";
$db->setQuery($query);
$fieldgroup = $db->loadObject();
$groupName = $fieldgroup->published != 1 ? "[" . $fieldgroup->name . "]" : $fieldgroup->name;
$appendInherit = "( " . $groupName . " )";
}
}
}
array_unshift($options, array('value' => '-1', 'text' => JText::_('COM_JUDOWNLOAD_INHERIT') . $appendInherit));
} else {
array_unshift($options, array('value' => '', 'text' => JText::_('COM_JUDOWNLOAD_SELECT_FIELD_GROUP')));
}
$required_class = $this->element['required'] == 'true' ? 'required' : '';
$attributes = "class=\"inputbox {$required_class}\"";
$html .= JHtml::_('select.genericlist', $options, $this->name, $attributes, 'value', 'text', $this->value, $this->id);
return $html;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:32,代码来源:fieldgroupforcat.php
示例13: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
// Load the modal behavior script.
JHtml::_('behavior.modal', 'a.modal');
// Build the script.
$script = array();
$script[] = ' function onBulletsSelect(data){';
$script[] = ' alert("do something: " + data)';
$script[] = ' SqueezeBox.close();';
$script[] = ' }';
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
// Setup variables for display.
$html = array();
$link = 'index.php?option=com_unitehcarousel&view=slider&layout=bullets&tmpl=component';
$html[] = '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '"' . ' value="' . $this->value . '" />';
$bulletsText = "Change Bullets";
$buttonID = $this->id . "-btn";
$desc = UniteFunctionsHCar::getVal($this->element, "description");
$htmlAddon = "";
if (!empty($desc)) {
$htmlAddon = ' title="' . $desc . '"';
//$class .= " hasTip"; //making problems with rel
}
// The user select button.
$html[] = ' <a id="' . $buttonID . '" class="modal panel_button" ' . $htmlAddon . ' href="' . $link . '&' . JSession::getFormToken() . '=1" rel="{handler: \'iframe\', size: {x: 900, y: 450}}">' . $bulletsText . '</a>';
$html = implode("\n", $html);
return $html;
}
开发者ID:ashanrupasinghe,项目名称:slbcv1,代码行数:35,代码来源:bullets.php
示例14: _setToolBar
/**
* Установки тулбара
*/
protected function _setToolBar()
{
require_once JPATH_COMPONENT . '/helpers/smfaq.php';
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
SmFaqHelper::addSubmenu($this->_name);
$canDo = SmFaqHelper::getActions($this->state->get('filter.category_id'));
// Выводим нужные кнопки и заголовок
JToolBarHelper::title(JText::_('COM_SMFAQ_MANAGER_QUESTIONS'), 'smfaq');
if ($canDo->get('core.create')) {
JToolBarHelper::addNewX('smfaq.add', 'JTOOLBAR_NEW');
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editListX('smfaq.edit', 'JTOOLBAR_EDIT');
}
JToolBarHelper::divider();
JToolBarHelper::custom('smfaqlist.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
JToolBarHelper::custom('smfaqlist.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
JToolBarHelper::divider();
JToolBarHelper::checkin('smfaqlist.checkin');
// Замена тулбара карзины на удаление
if ($this->state->get('filter.published') == -2) {
JToolBarHelper::deleteList('COM_SMFAQ_YOU_WANT_DELETE_THIS', 'smfaqlist.delete', 'JTOOLBAR_EMPTY_TRASH');
} else {
JToolBarHelper::trash('smfaqlist.trash', 'JTOOLBAR_TRASH');
}
JToolBarHelper::divider();
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_smfaq');
}
}
开发者ID:romuland,项目名称:khparts,代码行数:33,代码来源:view.html.php
示例15: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
global $JElementJSComboJSWritten;
if (!$JElementJSComboJSWritten) {
$jsFile = dirname(__FILE__) . DS . "jscombobox.js";
$jsUrl = str_replace(JPATH_ROOT, JURI::root(true), $jsFile);
$jsUrl = str_replace(DS, "/", $jsUrl);
$document = JFactory::getDocument();
$document->addScript($jsUrl);
$document->addstylesheet(str_replace('jscombobox.js', 'jscombobox.css', $jsUrl));
$JElementJSComboJSWritten = TRUE;
}
$html = array();
$attr = '';
// Initialize some field attributes.
$attr .= $this->element['class'] ? ' class="combobox ' . (string) $this->element['class'] . '"' : ' class="combobox"';
// To avoid user's confusion, readonly="true" should imply disabled="true".
if ((string) $this->element['readonly'] == 'true' || (string) $this->element['disabled'] == 'true') {
$attr .= ' disabled="disabled"';
}
$attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
// Initialize JavaScript field attributes.
$attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
// Get the field options.
$options = (array) $this->getOptions();
//store saved value for textbox
$attr .= $this->value ? ' data-value="' . $this->value . '"' : '';
// Create a regular list.
$html[] = JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id);
return implode($html);
}
开发者ID:scarsroga,项目名称:blog-soa,代码行数:37,代码来源:jscombo.php
示例16: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
// Initialize some field attributes.
$format = $this->element['format'] ? (string) $this->element['format'] : 'd.m.Y H:i';
$readonly = $this->element['readonly'] ? 'readonly="readonly"' : null;
if ($this->value && $this->value !== '0000-00-00 00:00:00') {
$this->value = JHtml::date($this->value, $format);
} else {
$this->value = null;
}
$jformat = str_replace('d', '%d', $format);
$jformat = str_replace('m', '%m', $jformat);
$jformat = str_replace('Y', '%Y', $jformat);
$jformat = str_replace('H', '%H', $jformat);
$jformat = str_replace('i', '%M', $jformat);
$time = JHtml::date('now', 'Hi');
$html = '<input name="' . $this->name . '" id="' . $this->id . '" value="' . $this->value . '"' . $readonly . ' /><img onmouseover="this.style.cursor=\'pointer\'" src="media/com_smfaq/images/calendar_icon.png" alt="Calendar" id="cal-' . $this->element['name'] . '" />';
$html .= '<script type="text/javascript">
Calendar.setup({
trigger : "cal-' . $this->element['name'] . '",
inputField : "' . $this->id . '",
dateFormat : "' . $jformat . '",
onSelect : function() { this.hide() },
showTime: true,
time: "' . $time . '",
});
</script>';
return $html;
}
开发者ID:romuland,项目名称:khparts,代码行数:35,代码来源:smcalendar.php
示例17: onDisplay
/**
* Display the button
*
* @return array A four element array of (article_id, article_title, category_id, object)
*/
function onDisplay($name)
{
/*
* Javascript to insert the link
* View element calls jSelectArticle when an article is clicked
* jSelectArticle creates the link tag, sends it to the editor,
* and closes the select frame.
*/
$js = "\n\t\tfunction jSelectArticle(id, title, catid, object) {\n\t\t\tvar tag = '<a href='+'\"index.php?option=com_content&view=article&catid='+catid+'&id='+id+'\">'+title+'</a>';\n\t\t\tjInsertEditorText(tag, '" . $name . "');\n\t\t\tSqueezeBox.close();\n\t\t}";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
JHtml::_('behavior.modal');
/*
* Use the built-in element view to select the article.
* Currently uses blank class.
*/
$link = 'index.php?option=com_content&view=articles&layout=modal&tmpl=component';
$button = new JObject();
$button->set('modal', true);
$button->set('link', $link);
$button->set('text', JText::_('PLG_ARTICLE_BUTTON_ARTICLE'));
$button->set('name', 'article');
$button->set('options', "{handler: 'iframe', size: {x: 770, y: 400}}");
return $button;
}
开发者ID:carmerin,项目名称:cesae-web,代码行数:30,代码来源:article.php
示例18: display
/**
* Display the view
*/
function display()
{
//DEVNOTE: set document title
$document =& JFactory::getDocument();
$document->setTitle(JText::_('NEW_DABATASE_CONNECTION'));
JHtml::script('dbConfigForm.js', 'media/com_dbconnect/js/');
JHtml::stylesheet('izi.css', 'media/com_dbconnect/css/');
if (@$this->pdoError != '') {
//máme chybu
$this->setLayout('error');
$this->assignRef('error', $this->pdoError);
} else {
if ($_POST['step'] == 2 && isset($_POST['db_table'])) {
//máme vybranou tabulku, musíme vybrat primární klíč
$this->setLayout('selectprimarykey');
$unidbModel = $this->getModel('unidb', 'unidbModel');
$this->assignRef('columns', $unidbModel->getColumns($_POST['db_table']));
} elseif ($_POST['step'] == 1 && isset($_POST['db_username']) && isset($_POST['db_password'])) {
//máme nastavené připojení k DB, musíme vybrat tabulku
$this->setLayout('selecttable');
$unidbModel = $this->getModel('unidb', 'unidbModel');
$this->assignRef('tables', $unidbModel->getTables());
} else {
//musíme vybrat nastavení serveru atp.
$this->setLayout('setdatabase');
$this->assignRef('dbTypes', $this->get('DBTypes'));
}
}
parent::display();
}
开发者ID:KIZI,项目名称:sewebar-cms,代码行数:33,代码来源:view.html.php
示例19: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
JHtml::_('jquery.framework');
$itemid = JFactory::getApplication()->input->getInt('id', 0);
$document = JFactory::getDocument();
$document->addScript(JUri::root() . 'administrator/components/com_dzproduct/assets/js/customfield.js');
JText::script('COM_DZPRODUCT_FIELD_CUSTOM_FIELD_ERROR_NO_FIELDS');
JText::script('COM_DZPRODUCT_FIELD_CUSTOM_FIELD_ERROR_LOAD_FIELDS');
JText::script('COM_DZPRODUCT_FIELD_CUSTOM_FIELD_BTN_EDIT_GROUP');
$html = '<div
id="' . $this->id . '"
class="form-horizontal customfield"
data-fieldname="' . $this->fieldname . '"
data-controller="' . $this->element['controller'] . '"
data-itemid="' . $itemid . '">
<div class="form-container"></div>
<img class="img-loading" src="' . JUri::root() . '/media/system/images/modal/spinner.gif" />
<div class="control-group">
<div class="controls">
<button class="btn btn-primary btn-reload"><span class="icon-refresh"></span> ' . JText::_('COM_DZPRODUCT_RELOAD_FIELDS') . '</button>
</div>
</div>
</div>';
return $html;
}
开发者ID:nadsrosun,项目名称:ProductComparisonDemo,代码行数:31,代码来源:customfield.php
示例20: edit
static function edit($weblink, $params, $attribs = array())
{
$user = JFactory::getUser();
$uri = JFactory::getURI();
if ($params && $params->get('popup')) {
return;
}
if ($weblink->state < 0) {
return;
}
JHtml::_('behavior.tooltip');
$url = WeblinksHelperRoute::getFormRoute($weblink->id, base64_encode($uri));
$icon = $weblink->state ? 'edit.png' : 'edit_unpublished.png';
$text = JHtml::_('image', 'system/' . $icon, JText::_('JGLOBAL_EDIT'), NULL, true);
if ($weblink->state == 0) {
$overlib = JText::_('JUNPUBLISHED');
} else {
$overlib = JText::_('JPUBLISHED');
}
$date = JHtml::_('date', $weblink->created);
$author = $weblink->created_by_alias ? $weblink->created_by_alias : $weblink->author;
$overlib .= '<br />';
$overlib .= $date;
$overlib .= '<br />';
$overlib .= htmlspecialchars($author, ENT_COMPAT, 'UTF-8');
$button = JHtml::_('link', JRoute::_($url), $text);
$output = '<span class="hasTip" title="' . JText::_('COM_WEBLINKS_EDIT') . ' :: ' . $overlib . '">' . $button . '</span>';
return $output;
}
开发者ID:christianesperar,项目名称:joomla-example,代码行数:29,代码来源:icon.php
注:本文中的JHtml类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论