本文整理汇总了PHP中KHelperArray类的典型用法代码示例。如果您正苦于以下问题:PHP KHelperArray类的具体用法?PHP KHelperArray怎么用?PHP KHelperArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KHelperArray类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: groups
public function groups(array $config = array())
{
$config = new KConfig($config);
$config->append(array('name' => 'group', 'core' => null));
$attribs = KHelperArray::toString($config->attribs);
$groups = $this->getService('com://admin/groups.model.groups')->set('core', is_null($config->core) ? null : $config->core)->getList();
if ($config->exclude instanceof KDatabaseRowInterface && $config->exclude->id) {
foreach (clone $groups as $group) {
if ($group->lft >= $config->exclude->lft && $group->rgt <= $config->exclude->rgt) {
$groups->extract($group);
}
}
}
foreach ($groups as $group) {
$checked = $config->selected == $group->id ? ' checked' : '';
if ($group->depth) {
$html[] = '<div style="padding-left: ' . $group->depth * 15 . 'px" class="clearfix">';
$html[] = '<input type="radio" name="' . $config->name . '" id="' . $config->name . $group->id . '" value="' . $group->id . '"' . $checked . ' ' . $attribs . '/>';
$html[] = '<label for="' . $config->name . $group->id . '">' . $group->name . '</label>';
$html[] = '</div>';
} else {
$html[] = '<h4>' . $group->name . '</h4>';
}
}
return implode(PHP_EOL, $html);
}
开发者ID:raeldc,项目名称:nooku-server,代码行数:26,代码来源:select.php
示例2: _renderLink
/**
* Render script information
*
* @param string The script information
* @param array Associative array of attributes
* @return string
*/
protected function _renderLink($link, $attribs = array())
{
$attribs = KHelperArray::toString($attribs);
$html = '<link href="'.$link.'" '.$attribs.'/>'."\n";
return $html;
}
开发者ID:raeldc,项目名称:com_learn,代码行数:14,代码来源:link.php
示例3: _calendar
/**
* Loads the calendar behavior and attaches it to a specified element
*
* @TODO generate patch for 12.3 making this bootstrap friendly
*
* @return string The html output
*/
private function _calendar($config = array())
{
$config = new KConfig($config);
$config->append(array('date' => gmdate("M d Y H:i:s"), 'name' => '', 'format' => '%Y-%m-%d %H:%M:%S', 'attribs' => array('size' => 25, 'maxlenght' => 19, 'class' => 'input-small', 'placeholder' => ''), 'gmt_offset' => JFactory::getConfig()->get('config.offset') * 3600));
if ($config->date && $config->date != '0000-00-00 00:00:00' && $config->date != '0000-00-00') {
$config->date = strftime($config->format, strtotime($config->date));
} else {
$config->date = '';
}
$html = '';
// Load the necessary files if they haven't yet been loaded
if (!isset(self::$_loaded['calendar'])) {
$html .= '<script src="media://lib_koowa/js/calendar.js" />';
$html .= '<script src="media://lib_koowa/js/calendar-setup.js" />';
$html .= '<style src="media://lib_koowa/css/calendar.css" />';
$html .= '<script>' . $this->_calendarTranslation() . '</script>';
self::$_loaded['calendar'] = true;
}
$html .= "<script>\n\t\t\t\t\twindow.addEvent('domready', function() {Calendar.setup({\n \t\t\t\tinputField : '" . $config->name . "',\n \t\t\t\tifFormat : '" . $config->format . "',\n \t\t\t\tbutton : 'button-" . $config->name . "',\n \t\t\t\talign : 'Tl',\n \t\t\t\tsingleClick : true,\n \t\t\t\tshowsTime\t : false\n \t\t\t\t});});\n \t\t\t</script>";
$attribs = KHelperArray::toString($config->attribs);
$html .= '<div class="input-append">';
$html .= '<input type="text" name="' . $config->name . '" id="' . $config->name . '" value="' . $config->date . '" ' . $attribs . ' />';
$html .= '<button type="button" id="button-' . $config->name . '" class="btn" >';
$html .= '<i class="icon-calendar"></i>‌';
//‌ is a zero width non-joiner, helps the button get the right height without adding to the width (like with )
$html .= '</button>';
$html .= '</div>';
return $html;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:36,代码来源:behavior.php
示例4: template
/**
* Checks to see if an image exists in the current templates image directory
* if it does it loads this image. Otherwise the default image is loaded.
*
* @param string The file name, eg foobar.png
* @param string The path to the image
* @param string Alt text
* @param array An associative array of attributes to add
* @param boolean True (default) to display full tag, false to return just the path
*/
public static function template($file, $folder = 'media/', $alt = NULL, $attribs = null, $toHtml = 1)
{
static $paths;
if (!$paths) {
$paths = array();
}
if (is_array($attribs)) {
$attribs = KHelperArray::toString($attribs);
}
$template = KFactory::get('lib.joomla.application')->getTemplate();
$path = JPATH_BASE . '/templates/' . $template . '/images/' . $file;
if (!isset($paths[$path])) {
if (file_exists(JPATH_BASE . '/templates/' . $template . '/images/' . $file)) {
$paths[$path] = 'templates/' . $template . '/images/' . $file;
} else {
// outputs only path to image
$paths[$path] = $folder . $file;
}
}
$src = $paths[$path];
// Prepend the base path
$src = JURI::base(true) . '/' . $src;
// outputs actual html <img> tag
if ($toHtml) {
return '<img src="' . $src . '" alt="' . html_entity_decode($alt) . '" ' . $attribs . ' />';
}
return $src;
}
开发者ID:janssit,项目名称:www.gincoprojects.be,代码行数:38,代码来源:image.php
示例5: radiolist
public function radiolist($config = array())
{
$config = new KConfig($config);
$config->append(array('list' => null, 'name' => 'id', 'attribs' => array(), 'key' => 'id', 'text' => 'title', 'selected' => null, 'translate' => false));
$name = $config->name;
$attribs = KHelperArray::toString($config->attribs);
$html = array();
foreach ($config->list as $row) {
$key = $row->{$config->key};
$text = $config->translate ? JText::_($row->{$config->text}) : $row->{$config->text};
$id = isset($row->id) ? $row->id : null;
$extra = '';
if ($config->selected instanceof KConfig) {
foreach ($config->selected as $value) {
$sel = is_object($value) ? $value->{$config->key} : $value;
if ($key == $sel) {
$extra .= 'selected="selected"';
break;
}
}
} else {
$extra .= $key == $config->selected ? 'checked="checked"' : '';
}
$html[] = '<label class="radio" for="' . $name . $id . '">' . $text;
$html[] = '<input type="radio" name="' . $name . '" id="' . $name . $id . '" value="' . $key . '" ' . $extra . ' ' . $attribs . ' />';
$html[] = '</label>';
}
return implode(PHP_EOL, $html);
}
开发者ID:JSWebdesign,项目名称:intranet-platform,代码行数:29,代码来源:listbox.php
示例6: startPanel
/**
* Creates a tab panel with title and starts that panel
*
* @param array An optional array with configuration options
* @return string Html
*/
public function startPanel($config = array())
{
$config = new KConfig($config);
$config->append(array('title' => '', 'attribs' => array(), 'options' => array(), 'translate' => true));
$title = $config->translate ? JText::_($config->title) : $config->title;
$attribs = KHelperArray::toString($config->attribs);
return '<dt ' . $attribs . '><span>' . $title . '</span></dt><dd>';
}
开发者ID:JSWebdesign,项目名称:intranet-platform,代码行数:14,代码来源:tabs.php
示例7: startPanel
/**
* Creates a tab panel with title and starts that panel
*
* @param string The title of the tab
* @param array An associative array of pane attributes
*/
public function startPanel($config = array())
{
$config = new KConfig($config);
$config->append(array('title' => 'Slide', 'attribs' => array(), 'translate' => true));
$title = $config->translate ? JText::_($config->title) : $config->title;
$attribs = KHelperArray::toString($config->attribs);
$html = '<div class="panel"><h3 class="jpane-toggler title" ' . $attribs . '><span>' . $title . '</span></h3><div class="jpane-slider content">';
return $html;
}
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:15,代码来源:accordion.php
示例8: fetchElement
public function fetchElement($name, $value, &$node, $control_name)
{
$config = new KConfig();
$config->append(array('name' => 'id', 'attribs' => array(), 'key' => 'id', 'text' => 'title', 'selected' => $value, 'translate' => false));
$name = $config->name;
$attribs = KHelperArray::toString($config->attribs);
$options = array();
foreach ($node->children() as $option) {
$options[] = (object) array($config->key => $option['value'], $config->text => (string) $option);
}
$config->list = $options;
$class = isset($node['class']) ? $node['class'] : 'value';
$html = array('<ul id="' . $this->name . '_id" class="' . $class . '">');
foreach ($config->list as $row) {
$key = $row->{$config->key};
$text = $config->translate ? JText::_($row->{$config->text}) : $row->{$config->text};
$id = isset($row->id) ? $row->id : null;
$extra = '';
if ($config->selected instanceof KConfig) {
foreach ($config->selected as $value) {
$sel = is_object($value) ? $value->{$config->key} : $value;
if ($key == $sel) {
$extra .= 'checked="checked"';
break;
}
}
} else {
$extra .= $key == $config->selected ? 'checked="checked"' : '';
}
$html[] = '<li class="value">';
$html[] = '<label for="' . $this->name . '_' . $key . '"><input type="checkbox" name="' . $this->name . '[]" id="' . $this->name . '_' . $key . '" value="' . $key . '" ' . $extra . ' ' . $attribs . ' />' . $text . '</label>';
$html[] = '</li>';
}
$html[] = '</ul>';
return implode(PHP_EOL, $html);
$options = array();
foreach ($node->children() as $option) {
$val = (string) $option['value'];
$text = (string) $option;
$options[] = (object) array('value' => $val, 'text' => $text);
}
$vertical = isset($node['vertical']) ? ' vertical' : null;
$html[] = '<ul class="group' . $vertical . '">';
$realname = $this->field . '[' . $this->group . '][' . $name . ']';
$idname = $this->field . '_' . $this->group . '_' . $name;
$checklist = KTemplateHelperSelect::checklist($options, $realname, $value, array('id' => '{id}'), 'value', 'text');
$search = array('for="' . $realname, 'id="' . $realname);
$replace = array('for="' . $idname, 'id="' . $idname);
$checklist = str_replace($search, $replace, $checklist);
foreach (explode('</label>', $checklist) as $check) {
$html[] = '<li class="value">';
$html[] = $check;
$html[] = '</label></li>';
}
$html[] = '</ul>';
return implode($html);
}
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:57,代码来源:check.php
示例9: input
/**
* Renders the input element, with the accept attribute set when needed
*
* @author Stian Didriksen <[email protected]>
* @return string
*/
public function input($config = array())
{
$config = new KConfig($config);
$config->append(array('attributes' => array('name' => 'attachments[]', 'type' => 'file')));
$params = JComponentHelper::getParams('com_media');
if (!$params->get('check_mime', false)) {
$config->attributes->append(array('accept' => htmlspecialchars($params->get('upload_mime'))));
}
return '<input ' . KHelperArray::toString($config->attributes->toArray()) . '/>';
}
开发者ID:ravenlife,项目名称:Ninjaboard,代码行数:16,代码来源:attachment.php
示例10: getUnused
/**
* Get a list of langpacks that haven't been added to the nooku languages table yet
*
* @return array
*/
public function getUnused()
{
$langs = KFactory::get('admin::com.nooku.model.languages')->getList();
$list = $this->getList();
foreach (KHelperArray::getColumn($langs->toArray(), 'iso_code') as $iso_code) {
if (isset($list[$iso_code])) {
unset($list[$iso_code]);
}
}
return $list;
}
开发者ID:janssit,项目名称:www.reliancelaw.be,代码行数:16,代码来源:langpacks.php
示例11: _renderStyle
/**
* Render style information
*
* @param string The style information
* @param boolean True, if the style information is a URL
* @param array Associative array of attributes
* @return string
*/
protected function _renderStyle($style, $link, $attribs = array())
{
$attribs = KHelperArray::toString($attribs);
if (!$link) {
$html = '<style type="text/css" ' . $attribs . '>' . "\n";
$html .= trim($style['data']);
$html .= '</style>' . "\n";
} else {
$html = '<link type="text/css" rel="stylesheet" href="' . $style . '" ' . $attribs . ' />' . "\n";
}
return $html;
}
开发者ID:JSWebdesign,项目名称:intranet-platform,代码行数:20,代码来源:style.php
示例12: _renderScript
/**
* Render script information
*
* @param string The script information
* @param boolean True, if the script information is a URL.
* @param array Associative array of attributes
* @return string
*/
protected function _renderScript($script, $link, $attribs = array())
{
$attribs = KHelperArray::toString($attribs);
if (!$link) {
$html = '<script type="text/javascript" ' . $attribs . '>' . "\n";
$html .= trim($script);
$html .= '</script>' . "\n";
} else {
$html = '<script type="text/javascript" src="' . $script . '" ' . $attribs . '></script>' . "\n";
}
return $html;
}
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:20,代码来源:script.php
示例13: write
/**
* Fixes blockquotes.
*
* @param string Block of text to parse
*
* @return KTemplateFilterLink
*/
public function write(&$text)
{
$matches = array();
if (preg_match_all('/<a(.*?)>/', $text, $matches)) {
foreach ($matches[1] as $index => $match) {
$attribs = $this->_parseAttributes($match);
$attribs['style'] = 'color:#076da0;text-decoration:none';
$attribs = KHelperArray::toString($attribs);
$text = str_replace($matches[0][$index], '<a ' . $attribs . ' >', $text);
}
}
return $this;
}
开发者ID:stonyyi,项目名称:anahita,代码行数:20,代码来源:link.php
示例14: select
public function select($config = array())
{
$config = new KConfig($config);
$config->append(array('name' => '', 'attribs' => array(), 'visible' => true, 'link' => '', 'link_text' => $this->translate('Select'), 'link_selector' => 'modal'))->append(array('id' => $config->name, 'value' => $config->name));
$attribs = KHelperArray::toString($config->attribs);
$input = '<input name="%1$s" id="%2$s" value="%3$s" %4$s size="40" %5$s />';
$link = '<a class="%s btn"
rel="{\'handler\': \'iframe\', \'size\': {\'x\': 690}}"
href="%s">%s</a>';
$html = sprintf($input, $config->name, $config->id, $config->value, $config->visible ? 'type="text" readonly' : 'type="hidden"', $attribs);
$html .= sprintf($link, $config->link_selector, $config->link, $config->link_text);
return $html;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:13,代码来源:modal.php
示例15: calendar
public function calendar($config = array())
{
$config = new KConfig($config);
$config->append(array(
'date' => gmdate("M d Y H:i:s"),
'name' => '',
'format' => '%Y-%m-%d %H:%M:%S',
'attribs' => array('size' => 25, 'maxlenght' => 19),
'gmt_offset' => KFactory::get('joomla:config')->getValue('config.offset') * 3600
));
if(!is_numeric($config->date)) {
$config->date = strtotime($config->date);
}
if($config->date) {
$config->date = strftime($config->format, $config->date /*+ $config->gmt_offset*/);
}
$html = '';
// Load the necessary files if they haven't yet been loaded
if (!isset(self::$_loaded['calendar']))
{
$html .= '<script src="media://system/js/calendar.js" />';
$html .= '<script src="media://system/js/calendar-setup.js" />';
$html .= '<style src="media://system/css/calendar-jos.css" />';
$html .= '<script>'.$this->_calendartranslation().'</script>';
self::$_loaded['calendar'] = true;
}
$html .= "<script>
window.addEvent('domready', function() {Calendar.setup({
inputField : '".$config->name."',
ifFormat : '".$config->format."',
button : 'button-".$config->name."',
align : 'Tl',
singleClick : true,
showsTime : false
});});
</script>";
$attribs = KHelperArray::toString($config->attribs);
$html .= '<input type="text" name="'.$config->name.'" id="'.$config->name.'" value="'.$config->date.'" '.$attribs.' />';
$html .= '<img class="calendar" src="media://system/images/calendar.png" alt="calendar" id="button-'.$config->name.'" />';
return $html;
}
开发者ID:raeldc,项目名称:com_learn,代码行数:50,代码来源:behavior.php
示例16: original
public function original($config)
{
$config = new KConfig($config);
$config->append(array('attribs' => array('class' => 'original-lang')));
$item = $config->item;
$html = '';
if ($item->isTranslatable() && !$item->translated) {
$original = $this->getService('com://admin/translations.model.translations')->table($item->getTable()->getName())->row($item->id)->original(1)->getItem();
if ($original->iso_code != $item->language && $original->id) {
$html .= '<span ' . KHelperArray::toString($config->attribs) . '>' . $this->translate('ONLY_AVAILABLE_' . strtoupper($original->lang) . '_SHORT') . '</span>';
}
}
return $html;
}
开发者ID:kedweber,项目名称:com_translations,代码行数:14,代码来源:languages.php
示例17: startPane
/**
* Creates a pane and creates the javascript object for it
*
* @param array An optional array with configuration options
* @return string Html
*/
public function startPane($config = array())
{
$config = new KConfig($config);
$config->append(array('id' => 'pane', 'attribs' => array(), 'options' => array()));
$html = '';
// Load the necessary files if they haven't yet been loaded
if (!isset($this->_loaded['tabs'])) {
$this->_loaded['tabs'] = true;
}
$id = strtolower($config->id);
$attribs = KHelperArray::toString($config->attribs);
$html .= "\n\t\t\t<script>\n\t\t\t\twindow.addEvent('domready', function(){ new KTabs('tabs-" . $id . "', " . json_encode($config->toData($config->options)) . "); });\n\t\t\t</script>";
$html .= '<dl class="tabs" id="tabs-' . $id . '" ' . $attribs . '>';
return $html;
}
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:21,代码来源:tabs.php
示例18: lang
/**
* MooTools.lang localization for Form.Validator.js and Date.js
*
* Will likely be moved to Napi once stable
*
* @author Stian Didriksen <[email protected]>
* @return void
*/
protected function lang()
{
$lang = KFactory::get('lib.joomla.language')->getTag();
$translate = create_function('$text', 'return ucfirst(JText::_($text));');
$months = json_encode(array_map($translate, array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December')));
$days = json_encode(array_map($translate, array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')));
$dateParts = explode('-', str_replace(array('%Y', '%M', '%D'), array('year', 'month', 'date'), JText::_('%Y-%M-%D')));
$dateOrder = json_encode($dateParts);
$shortDate = JText::_('DATE_FORMAT_LC4');
$translate = create_function('$text', 'return JText::_($text);');
$parts = array_map($translate, array('lessThanMinuteAgo' => 'less than a minute ago', 'minuteAgo' => 'about a minute ago', 'minutesAgo' => '{delta} minutes ago', 'hourAgo' => 'about an hour ago', 'hoursAgo' => 'about {delta} hours ago', 'dayAgo' => '1 day ago', 'daysAgo' => '{delta} days ago', 'weekAgo' => '1 week ago', 'weeksAgo' => '{delta} weeks ago', 'monthAgo' => '1 month ago', 'monthsAgo' => '{delta} months ago', 'yearAgo' => '1 year ago', 'yearsAgo' => '{delta} years ago', 'lessThanMinuteUntil' => 'less than a minute from now', 'minuteUntil' => 'about a minute from now', 'minutesUntil' => '{delta} minutes from now', 'hourUntil' => 'about an hour from now', 'hoursUntil' => 'about {delta} hours from now', 'dayUntil' => '1 day from now', 'daysUntil' => '{delta} days from now', 'weekUntil' => '1 week from now', 'weeksUntil' => '{delta} weeks from now', 'monthUntil' => '1 month from now', 'monthsUntil' => '{delta} months from now', 'yearUntil' => '1 year from now', 'yearsUntil' => '{delta} years from now'));
echo KHelperArray::toString($parts, ':', ',"');
die('<pre>' . var_export($parts, true) . '</pre>');
$this->_document->addScriptDeclaration("\n\t\t\tMooTools.lang.set('{$lang}', 'Date', {\n\t\t\t\n\t\t\t\tmonths: {$months},\n\t\t\t\tdays: {$days},\n\t\t\t\t//culture's date order: MM/DD/YYYY\n\t\t\t\tdateOrder: {$dateOrder},\n\t\t\t\tshortDate: '{$shortDate}',\t\t\t\n\t\t\t\t{$parts}\n\t\t\t});\n\t\t\t\n\t\t\tMooTools.lang.set('{$lang}', 'Form.Validator', {\n\t\t\t\n\t\t\t\trequired:'This field is required.',\n\t\t\t\tminLength:'Please enter at least {minLength} characters (you entered {length} characters).',\n\t\t\t\tmaxLength:'Please enter no more than {maxLength} characters (you entered {length} characters).',\n\t\t\t\tinteger:'Please enter an integer in this field. Numbers with decimals (e.g. 1.25) are not permitted.',\n\t\t\t\tnumeric:'Please enter only numeric values in this field (i.e. \"1\" or \"1.1\" or \"-1\" or \"-1.1\").',\n\t\t\t\tdigits:'Please use numbers and punctuation only in this field (for example, a phone number with dashes or dots is permitted).',\n\t\t\t\talpha:'Please use letters only (a-z) with in this field. No spaces or other characters are allowed.',\n\t\t\t\talphanum:'Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.',\n\t\t\t\tdateSuchAs:'Please enter a valid date such as {date}',\n\t\t\t\tdateInFormatMDY:'Please enter a valid date such as MM/DD/YYYY (i.e. \"12/31/1999\")',\n\t\t\t\temail:'Please enter a valid email address. For example \"[email protected]\".',\n\t\t\t\turl:'Please enter a valid URL such as http://www.google.com.',\n\t\t\t\tcurrencyDollar:'Please enter a valid \$ amount. For example \$100.00 .',\n\t\t\t\toneRequired:'Please enter something for at least one of these inputs.',\n\t\t\t\terrorPrefix: 'Error: ',\n\t\t\t\twarningPrefix: 'Warning: ',\n\t\t\t\n\t\t\t\t//Form.Validator.Extras\n\t\t\t\n\t\t\t\tnoSpace: 'There can be no spaces in this input.',\n\t\t\t\treqChkByNode: 'No items are selected.',\n\t\t\t\trequiredChk: 'This field is required.',\n\t\t\t\treqChkByName: 'Please select a {label}.',\n\t\t\t\tmatch: 'This field needs to match the {matchName} field',\n\t\t\t\tstartDate: 'the start date',\n\t\t\t\tendDate: 'the end date',\n\t\t\t\tcurrendDate: 'the current date',\n\t\t\t\tafterDate: 'The date should be the same or after {label}.',\n\t\t\t\tbeforeDate: 'The date should be the same or before {label}.',\n\t\t\t\tstartMonth: 'Please select a start month',\n\t\t\t\tsameMonth: 'These two dates must be in the same month - you must change one or the other.',\n\t\t\t\tcreditcard: 'The credit card number entered is invalid. Please check the number and try again. {length} digits entered.'\n\t\t\t\n\t\t\t});\n\t\t\tMooTools.lang.setLanguage('{$lang}');\n\t\t");
}
开发者ID:ravenlife,项目名称:Ninjaboard,代码行数:23,代码来源:html.php
示例19: _autocomplete
/**
* Renders a text input with autocomplete behavior
*
* @see KTemplateHelperBehavior::autocomplete
* @return string The html output
*/
protected function _autocomplete($config = array())
{
$config = new KConfig($config);
$config->append(array('model' => KInflector::pluralize($this->getIdentifier()->package)))->append(array('validate' => true, 'identifier' => 'com://' . $this->getIdentifier()->application . '/' . $this->getIdentifier()->package . '.identifier.' . KInflector::pluralize($config->model)));
if (!is_a($config->identifier, 'KServiceIdentifier')) {
$config->identifier = $this->getIdentifier($config->identifier);
}
$config->append(array('url' => JRoute::_('&option=com_' . $config->identifier->package . '&view=' . $config->identifier->name . '&format=json', false), 'column' => KInflector::singularize($config->identifier->name) . '_id'))->append(array('value' => $config->{$config->column} ? $config->{$config->column} : '', 'attribs' => array('name' => $config->column, 'type' => 'text', 'class' => 'inputbox value', 'size' => 60)))->append(array('options' => array('valueField' => $config->attribs->name . '-value')))->append(array('attribs' => array('id' => $config->attribs->name, 'data-value' => $config->options->valueField)));
if ($config->validate) {
$config->attribs->class = $config->attribs->class . ' ma-required';
}
//For the autocomplete behavior
$config->element = $config->attribs->id;
$html = $this->autocomplete($config);
$html .= '<input ' . KHelperArray::toString($config->attribs) . ' />';
$html .= '<input ' . KHelperArray::toString(array('type' => 'hidden', 'name' => $config->attribs->name, 'id' => $config->options->valueField, 'value' => $config->value)) . ' />';
return $html;
}
开发者ID:raeldc,项目名称:nooku-server,代码行数:24,代码来源:autocomplete.php
示例20: command
/**
* this sucks but we need to override this in order to use correct language strings
*
* @param array An optional array with configuration options
* @return string Html
*/
public function command($config = array())
{
$config = new KConfig($config);
$config->append(array('command' => NULL));
$command = $config->command;
//Add a toolbar class
$command->attribs->class->append(array('toolbar'));
//Create the id
$id = 'toolbar-' . $command->id;
$command->attribs->class = implode(" ", KConfig::unbox($command->attribs->class));
$html = '<td class="button" id="' . $id . '">';
$html .= ' <a ' . KHelperArray::toString($command->attribs) . '>';
$html .= ' <span class="' . $command->icon . '" title="' . JText::_($command->title) . '"></span>';
$html .= JText::_('COM_PORTFOLIO_' . $command->label);
$html .= ' </a>';
$html .= '</td>';
return $html;
}
开发者ID:ravenlife,项目名称:Portfolio,代码行数:24,代码来源:toolbar.php
注:本文中的KHelperArray类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论