/** * Initializes the default configuration for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param KConfig $config An optional KConfig object with configuration options. * * @return void */ protected function _initialize(KConfig $config) { $package = KInflector::humanize($this->getIdentifier()->package); $name = KInflector::humanize(KInflector::pluralize($this->getName())); $config->append(array('title' => $package . ' - ' . $name)); parent::_initialize($config); }
/** * Generates an HTML optionlist based on the distinct data from a model column. * * The column used will be defined by the name -> value => column options in * cascading order. * * If no 'model' name is specified the model identifier will be created using * the helper identifier. The model name will be the pluralised package name. * * If no 'value' option is specified the 'name' option will be used instead. * If no 'text' option is specified the 'value' option will be used instead. * * @param array An optional array with configuration options * @return string Html * @see __call() */ protected function _splitview($config = array()) { $config = new KConfig($config); $config->append(array('id' => 'splitview', 'name' => '', 'package' => 'com_' . $this->getIdentifier()->package))->append(array('master_view' => KInflector::pluralize($config->name), 'detail_view' => KInflector::singularize($config->name)))->append(array('options' => array('master_url' => '?option=' . $config->package . '&view=' . $config->master_view . '&format=json&sort=created_on&direction=desc', 'detail_url' => '?option=' . $config->package . '&view=' . $config->detail_view . '&format=raw', 'label' => array('empty' => JText::_('No ' . KInflector::humanize($config->master_view) . '.'), 'select' => JText::_('No ' . KInflector::humanize($config->detail_view) . ' selected.'))))); KFactory::get('admin::com.ninja.helper.default')->js('/splitview.js'); KFactory::get('admin::com.ninja.helper.default')->js("\njQuery(function(\$){\n\t\t\t\$('#" . $config->id . "').splitview(" . json_encode($config->options->toArray()) . ");\n\t\t});\n"); return '<div id="' . $config->id . '" class="splitview"></div>'; }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param array Options * @return array Options */ protected function _initialize(KConfig $options) { $name = isset($options->name) ? $options->name : (string) $this->node['name']; $id = isset($options->id) ? $options->id : isset($this->node['id']) ? (string) $this->node['id'] : $name; $label = isset($this->node['label']) ? (string) $this->node['label'] : false; $label = $label ? $label : KInflector::humanize((string) $this->node['name']); $options->append(array('parent' => false, 'identifier' => null, 'group' => false, 'fetchTooltip' => true, 'name' => $name, 'id' => $id, 'label' => $label)); parent::_initialize($options); }
/** * Initializes the config for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param object An optional KConfig object with configuration options * @return void */ protected function _initialize(KConfig $config) { $config->append(array( 'title' => KInflector::humanize($this->getName()), 'icon' => $this->getName(), 'controller' => null, )); parent::_initialize($config); }
public function display() { $name = $this->getName(); $toolbar = KFactory::get($this->getToolbar()); $toolbar->setTitle('Jedi: ' . KInflector::humanize($this->getName())); //Apend enable and disbale button for all the list views if (KInflector::isPlural($name)) { $toolbar->append('divider')->append('enable')->append('disable'); } return parent::display(); }
/** * @param int The row index * @param int The record id * @param boolean * @param string The name of the form element * @return string */ public function id($config = array()) { $config = new KConfig($config); $config->append(array('value' => false, 'locked' => false, 'name' => 'id', 'label' => KInflector::humanize(KInflector::singularize(KRequest::get('get.view', 'cmd'))), 'checked' => false)); if ($config->checked) { $config->checked = ' checked="checked"'; } if ($config->locked) { return ''; } return '<input type="checkbox" name="' . $config->name . '[]" class="id validate-reqchk-byname label:\'' . $config->label . '\'" value="' . $config->value . '"' . $config->checked . ' />'; }
/** * Constructor * * @param object An optional KConfig object with configuration options */ public function __construct(KConfig $config = null) { //If no config is passed create it if (!isset($config)) { $config = new KConfig(); } parent::__construct($config); // Set the title $title = empty($config->title) ? KInflector::humanize($this->getName()) : $config->title; $this->setTitle($title); // Set the icon $this->setIcon($config->icon); }
/** * Get a list over permissions for a group * * @param int $id The primary key * @return KDatabaseRowset */ public function getPermissions($id) { $table = KFactory::get('admin::com.ninjaboard.database.table.assets'); $query = $table->getDatabase()->getQuery(); $prefx = $table->getDatabase()->getTablePrefix(); $query->where('tbl.name', 'LIKE', 'com_ninjaboard.usergroup.' . $id . '.%'); $permissions = array(); foreach ($table->select($query, KDatabase::FETCH_ROWSET) as $permission) { $permission->column = end(explode('.', $permission->name)); $permission->title = KInflector::humanize($permission->column); $permissions[$permission->column] = $permission; } return $permissions; }
/** * Retrieve row field value * * @param string The column name. * @return string The corresponding column value. */ public function __get($column) { $result = parent::__get($column); if ($column != 'theme' || is_string($this->params) || !isset($this->params->board_details->theme)) { return $result; } if (!isset($this->_theme)) { if (!isset($this->_data['theme']) || !$this->_data['theme']) { $this->_data['theme'] = $this->params->board_details->theme; } $this->_theme = KInflector::humanize($this->_data['theme']); } return $this->_theme; }
public function display() { if (!$this->getModel()->getTotal()) { return parent::display(); } $this->_createToolbar()->prepend('spacer')->prepend(KFactory::get('admin::com.ninja.toolbar.button.modal', array('text' => 'Map', 'icon' => 'icon-32-map', 'link' => $this->createRoute('view=joomlausergroupmaps&tmpl=component'), 'y' => 470, 'handler' => 'iframe', 'ajaxOptions' => '{evalScripts:true}'))); $permissions = array(); $objects = KFactory::get('admin::com.ninjaboard.permissions')->getObjects(); foreach ($objects as $permission) { $permissions[$permission] = KInflector::humanize($permission); } $this->assign('columns', $permissions); $this->assign('colspan', 4 + count($permissions)); return parent::display(); }
protected function _actionEdit() { $identifier = $this->getIdentifier(); $id = $identifier->type . '_' . $identifier->package . '.' . $identifier->name . '.'; $data = KRequest::get('post', 'string'); $assets = KFactory::get('admin::com.ninja.helper.access')->models->assets; $model = KFactory::get($assets); foreach ($data['access'] as $controller => $access) { $name = $id . $controller; $data = array('name' => $name, 'title' => KInflector::humanize($controller) . ' permissions', 'rules' => json_encode($access)); $table = KFactory::get($model->getTable()); $query = KFactory::tmp('lib.koowa.database.query')->where('name', '=', $name); $table->fetchRow($query)->setData($data)->save(); } $this->_redirect = 'index.php?option=com_ninjaboard&view=permissions'; return $this->getModel()->getList(); }
/** * Render item pagination * * @param array $config Configuration array * @return string Html * @see http://developer.yahoo.com/ypatterns/navigation/pagination/ */ public function pagination($config = array()) { $config = new KConfig($config); $config->append(array('total' => 0, 'display' => 5, 'ajax' => false, 'name' => $this->name)); $this->_ajax = (bool) $config->ajax; if (is_string($config->ajax)) { $this->_ajax_layout = $config->ajax; } KFactory::get('admin::com.ninja.helper.default')->css('/pagination.css'); // Paginator object $paginator = KFactory::tmp('lib.koowa.model.paginator')->setData(array('total' => $config->total, 'offset' => $config->offset, 'limit' => $config->limit, 'dispay' => $config->display)); $view = $config->name; $items = (int) $config->total === 1 ? KInflector::singularize($view) : $view; if ($config->total <= 10) { return '<div class="pagination"><div class="limit">' . sprintf(JText::_('Listing %s ' . KInflector::humanize($items)), $config->total) . '</div></div>'; } // Get the paginator data $list = $paginator->getList(); $limitlist = $config->total > 10 ? $this->limit($config->toArray()) : $config->total; $html = '<div class="pagination">'; $html .= '<div class="limit">' . sprintf(JText::_('Listing %s ' . KInflector::humanize($items)), $limitlist) . '</div>'; $html .= $this->pages($list); $html .= '<div class="count"> ' . JText::_('Pages') . ' ' . $paginator->current . ' ' . JText::_('of') . ' ' . $paginator->count . '</div>'; $html .= '</div>'; if ($this->_ajax) { jimport('joomla.environment.browser'); $uagent = JBrowser::getInstance()->getAgentString(); $windoze = strpos($uagent, 'Windows') ? true : false; $url = clone KRequest::url(); $url->fragment = 'offset=@{offset}'; $formid = KFactory::tmp('admin::com.ninja.helper.default')->formid(); $cookie = KRequest::get('cookie.' . $formid, 'string', false); $states = array('total' => $total, 'offset' => $offset, 'limit' => $limit, 'display' => $display); if ($cookie) { $merge = KHelperArray::merge(json_decode($cookie, true), $states); KRequest::set('cookie.' . $formid, json_encode($merge), 'string'); } //Temp fix $cookie = false; $states = $cookie ? array() : array('state' => $states); KFactory::get('admin::com.ninja.helper.default')->js('/pagination.js'); KFactory::get('admin::com.ninja.helper.default')->js('window.addEvent(\'domready\', function(){ $$(\'div.pagination\')[0].paginator(' . json_encode(array_merge(array('identificator' => $formid, 'text' => array('count' => sprintf(JText::_('Pages %s of %s'), '@{current}', '@{total}'), 'first' => sprintf(JText::_('%s First'), $windoze ? '<<' : '❮❮'), 'previous' => sprintf(JText::_('%s Previous'), $windoze ? '<' : '❮'), 'next' => sprintf(JText::_('Next %s'), $windoze ? '>' : '❯'), 'last' => sprintf(JText::_('Last %s'), $windoze ? '>>' : '❯❯'))), $states)) . '); });'); } return $html; }
public function __construct(KConfig $config) { parent::__construct($config); $lang =& JFactory::getLanguage(); $orphans = $lang->getOrphans(); if ($orphans) { ksort($orphans, SORT_STRING); $guesses = array(); foreach ($orphans as $key => $occurance) { if (is_array($occurance) and isset($occurance[0])) { $info =& $occurance[0]; $file = @$info['step']['file']; $guess = str_replace('_', ' ', $info['string']); // Integers isn't translatable if (is_numeric($key) || strpos($key, '??') === 0 || strpos($guess, '•') === 0) { continue; } $guesses[] = array('file' => $file, 'keys' => strtoupper($key) . '=' . $guess); } } $append = false; foreach ($guesses as $guess) { if (!$guess['file'] || strpos($guess['file'], '/components/' . $config->option . '/') === false && strpos($guess['file'], '/components/com_ninja/') === false) { continue; } $append .= "\n" . $guess['keys']; } if (!$append) { return; } $langfile = key($lang->getPaths($config->option)); $readfile = JFile::read($langfile); $text = $readfile . "\n\n# " . KInflector::humanize(KRequest::get('get.view', 'cmd')) . "\n# @file " . $guess['file'] . "\n# @url " . KRequest::url() . "\n# @referrer " . KRequest::referrer() . "\n" . $append; JFile::write($langfile, $text); //echo $readfile; //die('<pre>'.var_export($langfile, true).'</pre>'); } //die('<script type="text/javascript">console.log('.json_encode($orphans).')</script>'); }
/** * Constructor * * @param array An optional associative array of configuration settings. */ public function __construct(KConfig $options) { parent::__construct($options); if (!isset($this->_buttons)) { $this->_buttons = array(); } $this->_name = empty($options->name) ? KRequest::get('get.view', 'cmd') : $options->name; $this->_title = empty($options->title) ? KInflector::humanize($this->getName()) : $options->title; KFactory::get('admin::com.ninja.helper.default')->css('/toolbar.css'); KFactory::get('admin::com.ninja.helper.default')->js('/toolbar.js'); if (KInflector::isSingular(KRequest::get('get.view', 'cmd', 'items'))) { KFactory::get('admin::com.ninja.helper.default')->js('window.addEvent(\'domready\',function(){if(formToolbar = $(\'' . KFactory::get('admin::com.ninja.helper.default')->formid() . '\')) formToolbar.addClass(\'validator-inline\');});'); } if (KInflector::isPlural($this->getName())) { $this->append('new')->append('edit')->append('delete'); } else { $this->append('save')->append('apply')->append('cancel'); } $template = KFactory::get('lib.joomla.application')->getTemplate(); $path = JPATH_THEMES . '/' . $template . '/html/com_' . $this->_identifier->package . '/toolbar'; KFactory::get($this->getTemplate())->addPath($path); $this->setLayout('admin::com.ninja.view.toolbar.toolbar_render'); $this->id = 'toolbar-' . $this->getName(); }
public function append($name = null, $attr = null, $msg = 'Add %s…') { if (!$name) { $name = $this->name; } $attributes = array('class' => $name, 'style' => '-moz-user-select: none', 'onselectstart' => 'return false;', 'ondragstart' => 'return false;', 'onclick' => "this.addClass('active'); return this;"); if (is_string($attr)) { $attributes['href'] = $attr; } else { $attributes = array_merge($attributes, (array) $attr); } $icon = KFactory::get('admin::com.ninja.helper.default')->img('/32/' . $name . '.png'); $style = '.placeholder .' . $attributes['class'] . ' > span { background-image: url(' . $icon . '); }'; if ($icon) { KFactory::get('lib.joomla.document')->addStyleDeclaration($style); } $attributes['class'] .= ' button'; $title = KInflector::humanize(KInflector::singularize($name)); $text = sprintf(JText::_($msg), JText::_($title)); if ($this->showButton) { $this->buttons[$name] = '<a ' . KHelperArray::toString($attributes) . '><span><span></span></span>' . $text . '</a>'; } return $this; }
<?php /** $Id: bar.php 567 2008-07-07 23:22:39Z mathias $ */ defined('_JEXEC') or die('Restricted access'); ?> <?php // get the chart @$chart->title(@text('Translation Progress')); // Data @$chart->set_data(@$data['MISSING']); @$chart->bar_3D(75, @$color->get('red'), @text('Missing'), 10); @$chart->set_data(@$data['OUTDATED']); @$chart->bar_3D(75, @$color->get('yellow'), @text('Outdated'), 10); @$chart->set_data(@$data['COMPLETED']); @$chart->bar_3D(75, @$color->get('green'), @text('Completed'), 10); @$chart->set_data(@$data['ORIGINAL']); @$chart->bar_3D(75, @$color->get('blue'), @text('Original'), 10); // Text $labels = KHelperArray::getColumn(@$languages, 'name'); @$chart->set_x_labels($labels); @$chart->set_x_legend(@$table_name ? KInflector::humanize(@$table_name) . ' ' . @text('Table') : @text('All Tables')); // Min, max and steps $max = KHelperMath::roundup(max(@$data['TOTAL']), -1); @$chart->set_y_max($max); @$chart->set_y_min(0); @$chart->set_y_label_steps($max / 10); @$chart->set_y_legend(@text('Items'), 14, '#000000');
echo 'row' . $m; ?> "> <td align="center"> <?php echo $i + 1; ?> </td> <td align="center"> <?php echo @helper('grid.id', $i, $table->id); ?> </td> <td> <?php echo KInflector::humanize($table->table_name); ?> </td> <td> <?php echo @text($table->comment); ?> </td> <td align="center"> <?php echo @helper('grid.enable', $table->enabled, $i); ?> </td> <?php if (JDEBUG) {
/** * Import an XML element definition * * @param SimpleXMLElement SimpleXMLElement object * @return this */ public function importXml(SimpleXMLElement $xml) { $this->_xml = $xml; $label = $this->_xml['label'] ? $this->_xml['label'] : KInflector::humanize($this->_xml['name']); $this->setName((string) $this->_xml['name']); $this->setDefault((string) $this->_xml['default']); $this->setLabel(JText::_((string) $label), $this->_xml['description']); foreach ($this->_xml->attributes() as $key => $attrib) { if (in_array($key, $this->_validAttribs)) { $this->setAttribute($key, (string) $attrib); } } return $this; }
<input type="checkbox" name="id[]" value="<?php echo $language->name; ?> -<?php echo $language->application == 'administrator' ? '1' : '0'; ?> " class="-koowa-grid-checkbox" <? if($language->default) echo 'disabled title="'.@escape(@text('DESCLANGUAGES')).'"' ?> /> </td> <td> <?php echo $language->name; ?> </td> <td align="center"> <?php echo @text(KInflector::humanize($language->application)); ?> </td> <td align="center"> <?php echo $language->version; ?> </td> <td> <?php echo @helper('date.format', array('date' => $language->creationDate, 'format' => '%d %B %Y')); ?> </td> <td> <span class="hasTip" title="<?php echo @text('Author Information');
public function render() { $html = array(); $backup = $this->_group; $closeHTML = null; //just initialize here, it will get overwritten later $i = 0; foreach ($this->toArray() as $name => $params) { $this->_group = $name; $group = current($this->getParams()); $class = @$group['class']; $title = @$group['title']; $legend = KInflector::humanize((string) $group['group']); switch ($this->_render) { case 'fieldset': $switch = isset($group['toggle']) ? ' toggle' : null; if (isset($group['togglehide']) && ($group['togglehide'] = 'yes')) { $class .= " toggleHide"; } $html[] = '<fieldset class="adminform ninja-form ' . $class . $switch . '">'; $html[] = '<legend title="' . $title . '">'; $html[] = isset($group['legend']) ? JText::_($group['legend']) : $legend; $html[] = '</legend>'; if (isset($group['toggle'])) { $html[] = '<div class="wrapper switch">'; $toggle = simplexml_load_string('<param name="enabled" type="text" default="forum" />'); $name = $this->_name . '[' . $this->_group . '][' . (string) $toggle['name'] . ']'; $id = $this->_name . $this->_group . (string) $toggle['name']; $value = $this->get((string) $toggle['name']); //DC - changed to type match to a string to differentiate between a "new" parameter with a default of "enabled" and a toggle that has been saved as off if ($value !== '0' && $group['toggle'] == 'enabled') { $value = 1; } $checked = $value ? ' checked="checked"' : null; KFactory::get('admin::com.ninja.helper.default')->js('/elements/toggle/touch.js'); KFactory::get('admin::com.ninja.helper.default')->js('/switch.js'); //DC Nov 2010 - moved css into a file as it was being repeated whenever there was more than one toggle on a page KFactory::get('admin::com.ninja.helper.default')->css("/toggle.css"); //DC Nov 2010 - temporarily removed the jtext because the buttons don't resize when the text is translated //todo - make the buttons resize and put back translation $on = 'ON'; //JText::_('on'); $off = 'OFF'; //JText::_('off'); $access = KFactory::get('admin::com.ninja.helper.default')->formid('forum'); KFactory::get('admin::com.ninja.helper.default')->js("\n \t\t\t\t\t\twindow.addEvent('domready', function() {\n \t\t\t\t\t\t\tvar toggle = new Switch('" . $id . "', {\n \t\t\t\t\t\t\t\tfocus: true, \n \t\t\t\t\t\t\t\tonChange: function(state) {\n \t\t\t\t\t\t\t\t\tvar value = (state) ? 1 : 0;\n \t\t\t\t\t\t\t\t\tthis.container.getPrevious().value = value;\n \t\t\t\t\t\t\t\t\tif(state == 1){\n \t\t\t\t\t\t\t\t\t\tthis.container.addClass('enabled').removeClass('disabled');\n \t\t\t\t\t\t\t\t\t\t\$('" . $id . "').getParent().getParent().getParent().getParent().getParent().removeClass('disabled').fade(1).getElements('input, select, textarea').set('disabled', false);\n \t\t\t\t\t\t\t\t\t\tif(\$('" . $id . "').getParent().getParent().getParent().getParent().getParent().hasClass('toggleHide')){\n \t\t\t\t\t\t\t\t\t\t\t\$('" . $id . "').getParent().getParent().getParent().getParent().getParent().getChildren('.element').reveal();\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t} else {\n \t\t\t\t\t\t\t\t\t\tthis.container.addClass('disabled').removeClass('enabled');\n \t\t\t\t\t\t\t\t\t\t\$('" . $id . "').getParent().getParent().getParent().getParent().getParent().addClass('disabled').fade(0.6).getElements('input, select, textarea').set('disabled', 'disabled');\n \t\t\t\t\t\t\t\t\t\t\$('" . $id . "').getParent().getParent().getParent().getParent().getElements('.hiddentoggle').set('disabled', false);\n \t\t\t\t\t\t\t\t\t\tif(\$('" . $id . "').getParent().getParent().getParent().getParent().getParent().hasClass('toggleHide')){\n \t\t\t\t\t\t\t\t\t\t\t\$('" . $id . "').getParent().getParent().getParent().getParent().getParent().getChildren('.element').dissolve();\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t});\n \t\t\t\t\t\t\t\$('{$id}').getParent().getNext().set('html', '<span class=\"on\">{$on}</span><span class=\"off\">{$off}</span>');\n \t\t\t\t\t\t});\n \t\t\t\t\t"); $html[] = ' <input name="' . $name . '" value="' . $value . '" type="hidden" class="hiddentoggle"/>'; $html[] = ' <input type="checkbox" class="toggle inclToggle" id="' . $id . '"' . $checked . ' />'; $html[] = '</div>'; } //closing statement for the above HTML. It is appended later $closeHTML = '</fieldset>'; break; case 'accordion': jimport('joomla.html.pane'); $panel = JPane::getInstance('sliders', array('allowAllClose' => 'true')); $html[] = $panel->startPane($class); $html[] = $panel->startPanel(isset($group['legend']) ? $group['legend'] : $legend, $title); $closeHTML = $panel->endPanel() . $panel->endPane(); break; case 'tabs': jimport('joomla.html.pane'); $panel = JPane::getInstance('tabs', array('allowAllClose' => 'true')); //TODO - D: there is a good chance this won't work because the panels should all be in the same pane //do soem testing and expand this to opening and closing the pane outside the loop if needed. $html[] = $panel->startPane($class); $html[] = $panel->startPanel(isset($group['legend']) ? $group['legend'] : $legend, $title); $closeHTML = $panel->endPanel() . $panel->endPane(); break; default: $html[] = '<div class="adminform ninja-form ' . $class . '">'; //closing statement for the above HTML. It is appended later $closeHTML = '</div>'; break; } foreach ($params as $param) { $html[] = $param['element']->before('<div class="element">'); /** * Here we're using toString for debugging. * * @TODO: Change to (string) $param['element']; when tested stable. * */ $html[] = $param['element']->toString(); $html[] = $param['element']->after('</div>'); } $group = $this->_group; //add our closing statement $html[] = $closeHTML; $i++; } return implode($html); }
/** * Filter that gets the redirect URL from the sesison and sets it in the * controller * * @return void */ public function setMessage(KCommandContext $context) { $defaults = array('url' => null, 'message' => null); $redirect = array_merge($defaults, $this->getRedirect()); if (!$redirect['message']) { $message = new KObject(); $message->count = count((array) KRequest::get('post.id', 'int', 1)); $message->action = ' ' . KFactory::tmp('admin::com.ninja.helper.inflector')->verbalize(KRequest::get('post.action', 'cmd', $this->getAction())) . '.'; $message->name = KFactory::get($this->getModel())->getIdentifier()->name; $message->singular = KInflector::humanize(KInflector::singularize($message->name)) . $message->action; $message->plural = KInflector::humanize(KInflector::pluralize($message->name)) . $message->action; $redirect['message'] = sprintf(JText::_($message->count > 1 ? '%s ' . $message->plural : $message->singular), $message->count); $this->_redirect_message = $redirect['message']; } }
"> <fieldset class="ninja-col adminform ninja-form right"> <legend> <select id="<?php echo $select; ?> " class="value"> <?php foreach ($this->controllers as $name => $controller) { ?> <option value="<?php echo @ninja('default.formid', $name); ?> "> <?php echo @text(KInflector::humanize(KInflector::pluralize($name))); ?> </option> <?php } ?> </select> </legend> <?php foreach ($this->controllers as $name => $controller) { ?> <?php @($actions = KFactory::tmp('admin::com.ninja.helper.access', array('name' => 'com_ninjaboard.permission.' . $name, 'actions' => $controller, 'id' => @ninja('default.formid', $name), 'inputName' => 'access[' . $name . ']', 'inputId' => 'access-' . $name, 'default' => $name == 'default'))); ?>
protected function _renderUsergroups() { $levels = $this->getLevels(); $rules = $this->getAssetRules(); // Get the available user groups. $groups = $this->objects; // Build the form control. $html = array(); // Open the table. $html[] = '<div id="' . $this->id . '" class="permissions"><table class="permissionlist">'; // The table heading. $html[] = ' <thead>'; $html[] = ' <tr>'; $html[] = ' <th>'; $html[] = ' <span class="acl-action">' . JText::_('Object') . '</span>'; $html[] = ' </th>'; $html[] = ' <th colspan="' . count($levels) . '" class="permission-level">'; $html[] = ' <span class="acl-action">' . JText::_('Permissions Level') . '</span>'; $html[] = ' </th>'; $html[] = ' </tr>'; $html[] = ' </thead>'; // The table body. $html[] = ' <tbody>'; foreach ($groups as $group) { $html[] = ' <tr class="' . KFactory::get('admin::com.ninja.helper.grid')->zebra() . '" data-object="' . $group . '">'; $html[] = ' <th class="acl-groups">'; $html[] = ' ' . JText::_(KInflector::humanize($group)); $html[] = ' </th>'; $active = isset($rules[$group]) ? $rules[$group] : 1; foreach ($levels as $i => $level) { $id = $this->inputId . '-' . $group . '-' . $i; $checked = $active == $i ? ' checked="checked"' : ''; $html[] = ' <td class="permissions-level level-' . $i . '">'; $html[] = ' <input type="radio" name="' . $this->inputName . '[' . $group . ']" id="' . $id . '" value="' . $i . '" ' . $checked . ' />'; $html[] = ' <label for="' . $id . '">'; $html[] = JText::_($level); $html[] = '</label>'; $html[] = ' </td>'; } $html[] = ' </tr>'; } $html[] = ' </tbody>'; // Close the table. $html[] = '</table></div>'; return implode($html); }
<input type="checkbox" name="id[]" value="<?php echo $template->name; ?> -<?php echo $template->application == 'administrator' ? '1' : '0'; ?> " class="-koowa-grid-checkbox" <? if($template->default) echo 'disabled title="'.@escape(@text('DESCTEMPLATES')).'"' ?> /> </td> <td> <?php echo $template->name; ?> </td> <td align="center"> <?php echo @text(KInflector::humanize($template->application)); ?> </td> <td align="center"> <?php echo $template->version; ?> </td> <td> <?php echo @helper('date.format', array('date' => $template->creationDate, 'format' => '%d %B %Y')); ?> </td> <td> <span class="hasTip" title="<?php echo @text('Author Information');
public function getDocumentSubTitle() { if (!$this->_subtitle) { $this->_subtitle = JText::_(KInflector::humanize($this->getName())); } return $this->_subtitle; }
/** * Gets a more descriptive name for the converter * * Is used for the button label, "Importing from XYZ" messages and like * * @return string */ public function getTitle() { return isset($this->_title) ? $this->_title : KInflector::humanize($this->getName()); }
<? foreach($modules as $module) : ?> <tr <? if($module->iscore) echo 'data-readonly' ?>> <td align="center"> <input type="checkbox" name="id[]" value="<?php echo $module->id; ?> " class="-koowa-grid-checkbox" <? if($module->iscore) echo 'disabled title="'.@escape(@text('DESCMODULES')).'"' ?> /> </td> <td> <?php echo $module->type; ?> </td> <td align="center"> <?php echo @text(KInflector::humanize($module->application)); ?> </td> <td align="center"> <?php echo $module->version; ?> </td> <td> <?php echo @helper('date.format', array('date' => $module->creationDate, 'format' => '%d %B %Y')); ?> </td> <td> <span class="hasTip" title="<?php echo @text('Author Information');
/** * Function for getting a plural and human readable version of a name * * @author Stian Didriksen <*****@*****.**> * @param bool $pluralize Wether to pluralize or not */ public function getReadableName($pluralize = true) { $name = $this->getName(); if ($pluralize && KInflector::isSingular($name)) { $name = KInflector::pluralize($name); } return KInflector::humanize($name); }
public function livetitle($config = array()) { $config = new KConfig($config); $config->append(array('doctitle' => KFactory::get('lib.joomla.document')->getTitle(), 'placeholder' => JText::_(KInflector::humanize(KRequest::get('get.view', 'cmd'))), 'title' => false, 'target' => 'title')); $document = KFactory::get('lib.joomla.document'); ob_start(); ?> window.addEvent('domready', function(){ $('<?php echo $config->target; ?> ').set('autocomplete', 'off'); var setTitle = function(){ document.title=this.value ? this.value + <?php echo json_encode(' | ' . $config->doctitle); ?> : <?php echo json_encode($config->doctitle); ?> ; var header = document.getElement('#toolbar-box .header') || document.getElement('.header') || document.getElement('#toolbar-top h3') || document.getElement('#mc-title h1'); if(header) header.set('text', this.value || <?php echo json_encode($config->placeholder); ?> ); }; $('<?php echo $config->target; ?> ').addEvents({'keyup': setTitle, 'keydown': setTitle,'change': setTitle}); }); <?php if ($config->title) { ?> <?php $document->setTitle($config->title . ' | ' . $config->doctitle); ?> window.addEvent('domready', function(){ var header = document.getElement('#toolbar-box .header') || document.getElement('.header') || document.getElement('#toolbar-top h3') || document.getElement('#mc-title h1'); if(header) header.set('text', <?php echo json_encode($config->title); ?> ); }); <?php } ?> <?php KFactory::get('admin::com.ninja.helper.default')->js(ob_get_clean()); return; }