本文整理汇总了PHP中RLayoutHelper类的典型用法代码示例。如果您正苦于以下问题:PHP RLayoutHelper类的具体用法?PHP RLayoutHelper怎么用?PHP RLayoutHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RLayoutHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInput
/**
* Method to get the field input markup
*
* @return string
*
* @throws Exception
*/
protected function getInput()
{
// Setup variables for display
if ($this->value) {
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('r.name')->from('#__tracks_projects_rounds AS pr')->join('INNER', '#__tracks_rounds AS r ON r.id = pr.round_id')->where('pr.id = ' . (int) $this->value);
$db->setQuery($query);
$title = $db->loadResult();
if (!($title = $db->loadResult())) {
throw new Exception($db->getErrorMsg(), 500);
}
}
if (empty($title)) {
$title = JText::_('COM_TRACKS_Select_a_project_round');
}
$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
// The active id field
if (0 == (int) $this->value) {
$value = '';
} else {
$value = (int) $this->value;
}
$class = '';
if ($this->required) {
$class = ' class="required modal-value"';
}
return RLayoutHelper::render('form.field.projectround', array('id' => $this->id, 'name' => $this->name, 'title' => $title, 'value' => $this->value, 'required' => $this->required), '', array('component' => 'com_tracks'));
}
示例2: getInput
/**
* Method to get the user field input markup.
*
* @return string The field input markup.
*
* @since 1.0
*/
protected function getInput()
{
$html = array();
$groups = $this->getGroups();
$excluded = $this->getExcluded();
$link = 'index.php?option=com_users&view=users&layout=modal&tmpl=component&field=' . $this->id . (isset($groups) ? '&groups=' . base64_encode(json_encode($groups)) : '') . (isset($excluded) ? '&excluded=' . base64_encode(json_encode($excluded)) : '') . '&redcore=true';
// Initialize some field attributes.
if (isset($this->element['required']) && $this->element['required'] == 'true') {
$this->addAttribute('required', 'required');
}
// Automatically insert any other attribute inserted
if ($elementAttribs = $this->element->attributes()) {
foreach ($elementAttribs as $name => $value) {
if (!in_array($name, $this->forbiddenAttributes)) {
$this->addAttribute($name, $value);
}
}
}
$modalTitle = isset($this->element['modal_title']) ? JText::_($this->element['modal_title']) : JText::_('JLIB_FORM_SELECT_USER');
$modalId = 'modal-' . $this->id;
// Build the script.
$script = array();
$script[] = ' function jSelectUser_' . $this->id . '(id, title) {';
$script[] = ' var old_id = document.getElementById("' . $this->id . '_id").value;';
$script[] = ' if (old_id != id) {';
$script[] = ' document.getElementById("' . $this->id . '_id").value = id;';
$script[] = ' document.getElementById("' . $this->id . '").value = title;';
$script[] = ' document.getElementById("' . $this->id . '").className = document.getElementById("' . $this->id . '").className.replace(" invalid" , "");';
$script[] = ' ' . (string) $this->element['onchange'];
$script[] = ' }';
$script[] = ' jQuery("#' . $modalId . '").modal("hide")';
$script[] = ' }';
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
// Create the modal object
$modal = RModal::getInstance(array('attribs' => array('id' => $modalId, 'class' => 'modal hide', 'style' => 'width: 800px; height: 500px;'), 'params' => array('showHeader' => true, 'showFooter' => false, 'showHeaderClose' => true, 'title' => $modalTitle, 'link' => $link)), $modalId);
$html[] = RLayoutHelper::render('modal', $modal);
// Load the current username if available.
$table = JTable::getInstance('user');
if ($this->value) {
$table->load($this->value);
} else {
$table->username = JText::_('JLIB_FORM_SELECT_USER');
}
$attr = $this->parseAttributes();
// Create a dummy text field with the user name.
$html[] = '<div class="input-append">';
$html[] = ' <input type="text" id="' . $this->id . '" value="' . htmlspecialchars($table->name, ENT_COMPAT, 'UTF-8') . '"' . ' readonly="readonly"' . $attr . ' />';
// Create the user select button.
if ($this->element['readonly'] != 'true') {
$html[] = ' <a class="btn btn-primary modalAjax" data-toggle="modal" title="' . JText::_('JLIB_FORM_CHANGE_USER') . '" href="#' . $modalId . '"' . ' rel="{handler: \'iframe\', size: {x: 800, y: 500}}">';
$html[] = '<i class="icon-user"></i></a>';
}
$html[] = '</div>';
// Create the real field, hidden, that stored the user id.
$html[] = '<input type="hidden" id="' . $this->id . '_id" name="' . $this->name . '" value="' . (int) $this->value . '" />';
return implode("\n", $html);
}
示例3: getInput
/**
* Method to get the field input markup for OAuth2 Scope Lists.
*
* @return string The field input markup.
*/
protected function getInput()
{
// ShowCheckAll attribute process
$showCheckAll = false;
if ($this->getAttribute('showCheckAll', false) == true) {
$showCheckAll = true;
}
return RLayoutHelper::render('webservice.scopes', array('view' => $this, 'options' => array('scopes' => $this->getOptions(), 'id' => $this->id, 'name' => $this->name, 'label' => $this->label, 'value' => $this->value, 'showCheckAll' => $showCheckAll)));
}
示例4: 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)
{
$render = RLayoutHelper::render($this->componentLayout, array('view' => $this, 'tpl' => $tpl, 'component_title' => $this->componentTitle));
if ($render instanceof Exception) {
return $render;
}
echo $render;
return true;
}
示例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)
{
$render = RLayoutHelper::render('component', array('view' => $this, 'tpl' => $tpl, 'component_title' => $this->componentTitle, 'sidebar_display' => $this->displaySidebar, 'sidebar_layout' => $this->sidebarLayout, 'sidebar_data' => $this->sidebarData, 'topbar_display' => $this->displayTopBar, 'topbar_layout' => $this->topBarLayout, 'topbar_inner_layout_display' => $this->displayTopBarInnerLayout, 'topbar_inner_layout' => $this->topBarInnerLayout, 'topbar_inner_layout_data' => $this->topBarInnerLayoutData, 'display_joomla_menu' => $this->displayJoomlaMenu));
if ($render instanceof Exception) {
return $render;
}
echo $render;
return true;
}
示例6: getInput
/**
* Method to get the field input markup for a generic list.
* Use the multiple attribute to enable multiselect.
*
* @return string The field input markup.
*
* @since 11.1
*/
protected function getInput()
{
$app = JFactory::getApplication();
$listType = !empty($this->element['listType']) ? $this->element['listType'] : RBootstrap::getConfig('payment_list_payments_type', 'radio');
$extensionName = !empty($this->element['extensionName']) ? $this->element['extensionName'] : $app->input->get->getString('option', '');
$ownerName = !empty($this->element['ownerName']) ? $this->element['ownerName'] : '';
// Get the field options.
$options = $this->getOptions();
return RLayoutHelper::render('redpayment.list.' . strtolower($listType), array('options' => array('payments' => $options, 'extensionName' => $extensionName, 'ownerName' => $ownerName, 'name' => $this->name, 'value' => $this->value, 'id' => $this->id, 'attributes' => $this->getAttributes())));
}
示例7: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*/
protected function getInput()
{
$id = isset($this->element['id']) ? $this->element['id'] : null;
$this->cssId = '#' . $this->getId($id, $this->element['name']);
if (isset($this->element['inline']) && $this->element['inline'] == 'true') {
$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
$this->fieldHtml = '<div id="' . $this->getId($id, $this->element['name']) . '" ' . $class . '></div>';
} else {
$this->fieldHtml = parent::getInput();
}
$this->datepickerOptions = $this->getDatepickerOptions();
return RLayoutHelper::render('fields.rdatepicker', $this);
}
示例8: render
/**
* Renders the error stack and returns the results as a string
*
* @param string $name Not used.
* @param array $params Associative array of values
* @param string $content Not used.
*
* @return string The output of the script
*
* @since 11.1
*/
public function render($name, $params = array(), $content = null)
{
$msgList = $this->getData();
$displayData = array('msgList' => $msgList, 'name' => $name, 'params' => $params, 'content' => $content);
$app = JFactory::getApplication();
$chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/message.php';
if (file_exists($chromePath)) {
include_once $chromePath;
}
if (function_exists('renderMessage')) {
JLog::add('renderMessage() is deprecated. Override system message rendering with layouts instead.', JLog::WARNING, 'deprecated');
return renderMessage($msgList);
}
return RLayoutHelper::render('joomla.system.message', $displayData);
}
示例9: getInput
/**
* Method to get the user field input markup.
*
* @return string The field input markup.
*
* @since 1.6
*/
protected function getInput()
{
$html = array();
$groups = $this->getGroups();
$excluded = $this->getExcluded();
$link = 'index.php?option=com_users&view=users&layout=modal&tmpl=component&field=' . $this->id . (isset($groups) ? '&groups=' . base64_encode(json_encode($groups)) : '') . (isset($excluded) ? '&excluded=' . base64_encode(json_encode($excluded)) : '');
// Initialize some field attributes.
$attr = !empty($this->class) ? ' class="' . $this->class . '"' : '';
$attr .= !empty($this->size) ? ' size="' . $this->size . '"' : '';
$attr .= $this->required ? ' required' : '';
// Build the script.
$script = array();
$script[] = ' function jSelectUser_' . $this->id . '(id, title) {';
$script[] = ' var old_id = document.getElementById("' . $this->id . '_id").value;';
$script[] = ' if (old_id != id) {';
$script[] = ' document.getElementById("' . $this->id . '_id").value = id;';
$script[] = ' document.getElementById("' . $this->id . '").value = title;';
$script[] = ' document.getElementById("' . $this->id . '").className = document.getElementById("' . $this->id . '").className.replace(" invalid" , "");';
$script[] = ' ' . $this->onchange;
$script[] = ' }';
$script[] = ' jQuery("#modalContainer_modalButton_' . $this->id . '").modal("hide");';
$script[] = ' }';
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
// Load the current username if available.
$table = JTable::getInstance('user');
if (is_numeric($this->value)) {
$table->load($this->value);
} elseif (strtoupper($this->value) == 'CURRENT') {
// 'CURRENT' is not a reasonable value to be placed in the html
$this->value = JFactory::getUser()->id;
$table->load($this->value);
} else {
$table->name = JText::_('JLIB_FORM_SELECT_USER');
}
// Create a dummy text field with the user name.
$html[] = '<div class="input-append">';
$html[] = ' <input type="text" id="' . $this->id . '" value="' . htmlspecialchars($table->name, ENT_COMPAT, 'UTF-8') . '"' . ' readonly' . $attr . ' />';
// Create the user select button.
if ($this->readonly === false) {
$html[] = RLayoutHelper::render('modal.iframe', array('view' => $this, 'options' => array('id' => $this->id, 'header' => JText::_('JLIB_FORM_CHANGE_USER'), 'linkName' => '<i class="icon-user"></i>', 'link' => $link, 'linkClass' => 'btn btn-primary')));
}
$html[] = '</div>';
// Create the real field, hidden, that stored the user id.
$html[] = '<input type="hidden" id="' . $this->id . '_id" name="' . $this->name . '" value="' . $this->value . '" />';
return implode("\n", $html);
}
示例10: ajaxlogs
/**
* Ajax call to get logs tab content.
*
* @return void
*/
public function ajaxlogs()
{
$app = JFactory::getApplication();
$input = $app->input;
$paymentId = $input->getInt('id');
if ($paymentId) {
/** @var RedcoreModelPayment_Logs $logsModel */
$logsModel = RModelAdmin::getAdminInstance('Payment_Logs', array(), 'com_redcore');
$state = $logsModel->getState();
$logsModel->setState('filter.payment_id', $paymentId);
$app->setUserState('log.payment_id', $paymentId);
$formName = 'logsForm';
$pagination = $logsModel->getPagination();
$pagination->set('formName', $formName);
echo RLayoutHelper::render('payment.logs', array('state' => $state, 'items' => $logsModel->getItems(), 'pagination' => $pagination, 'filterForm' => $logsModel->getForm(), 'activeFilters' => $logsModel->getActiveFilters(), 'formName' => $formName, 'showToolbar' => true, 'action' => RRoute::_('index.php?option=com_redcore&view=payment&model=payment_logs'), 'return' => base64_encode('index.php?option=com_redcore&view=payment&layout=edit&id=' . $paymentId . '&tab=logs&from_payment=1')));
}
$app->close();
}
示例11: display
/**
* Display method
*
* @param string $tpl The template name
*
* @return void
*/
public function display($tpl = null)
{
/** @var RedcoreModelConfig $model */
$model = $this->getModel('Config');
$option = JFactory::getApplication()->input->getString('component', 'com_redcore');
$lang = JFactory::getLanguage();
// Load component language files
$lang->load($option, JPATH_ADMINISTRATOR, 'en-GB', false, false) || $lang->load($option, JPATH_ADMINISTRATOR . '/components/' . $option, 'en-GB', false, false);
$this->form = $model->getForm();
$this->component = $model->getComponent($option);
$this->return = JFactory::getApplication()->input->get('return', '', 'Base64');
$this->componentTitle = RText::getTranslationIfExists($this->component->xml->name, '', '');
$this->contentElements = $model->loadContentElements($option);
$this->missingContentElements = $model->loadMissingContentElements($option, $this->contentElements);
RLayoutHelper::$defaultBasePath = JPATH_ADMINISTRATOR . '/components/' . $option . '/layouts';
$extensionXml = RComponentHelper::getComponentManifestFile($option);
if (isset($extensionXml->redcore)) {
$attributes = $extensionXml->redcore->attributes();
if (!empty($attributes['defaultFramework'])) {
RHtmlMedia::setFramework((string) $attributes['defaultFramework']);
}
}
parent::display($tpl);
}
示例12: defined
<?php
/**
* @package Redcore
* @subpackage Layouts
*
* @copyright Copyright (C) 2008 - 2015 redCOMPONENT.com. All rights reserved.
* @license GNU General Public License version 2 or later, see LICENSE.
*/
defined('JPATH_REDCORE') or die;
$data = (object) $displayData;
$options = !empty($data->field->ajaxchildOptions) ? $data->field->ajaxchildOptions : array();
// We won't load anything if it's not going to work
if (!empty($options['ajaxUrl'])) {
$options['childSelector'] = isset($options['childSelector']) ? $options['childSelector'] : '.js-childlist-child';
JHtml::_('rjquery.childlist', $options['childSelector'], $options);
}
// Render the standard select
echo RLayoutHelper::render('redcore.field.list', $data);
示例13: foreach
foreach ($modules as $module) {
?>
<?php
echo JModuleHelper::renderModule($module, array('style' => 'standard'));
?>
<?php
}
?>
<?php
}
?>
<?php
if ($displayTopbarInnerLayout) {
?>
<?php
echo RLayoutHelper::render($topbarInnerLayout, $topbarInnerLayoutData);
?>
<?php
}
?>
</div>
<ul class="nav nav-user navbar-right">
<li class="dropdown">
<a href="#" data-toggle="dropdown" class="dropdown-toggle">
<span class="icon-user"></span>
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li class="">
<a href="index.php?option=com_admin&task=profile.edit&id=<?php
echo $userId;
示例14: render
/**
* Render the toolbar.
*
* @return string The rendered toolbar.
*/
public function render()
{
return RLayoutHelper::render('toolbar.toolbar', array('toolbar' => $this));
}
示例15: defined
<?php
/**
* @package Redcore.Admin
* @subpackage Templates
*
* @copyright Copyright (C) 2008 - 2015 redCOMPONENT.com. All rights reserved.
* @license GNU General Public License version 2 or later, see LICENSE.
*/
defined('_JEXEC') or die;
echo RLayoutHelper::render('webservice.operation', array('view' => $this, 'options' => array('operation' => 'update', 'form' => $this->form, 'tabActive' => ' active in ', 'fieldList' => array('defaultValue', 'isRequiredField', 'isPrimaryField'))));