public function _createToolbar() { $identifier = $this->getToolbar(); $name = $identifier->name; $package = $identifier->package; KFactory::get('admin::com.ninja.helper.default')->css('/toolbar.css'); $img = KInflector::isPLural($name) ? KFactory::get('admin::com.ninja.helper.default')->img('/48/' . $name . '.png') : KFactory::get('admin::com.ninja.helper.default')->img('/48/' . KInflector::pluralize($name) . '.png'); if (!$img) { $img = KInflector::isSingular($name) ? KFactory::get('admin::com.ninja.helper.default')->img('/48/' . $name . '.png') : KFactory::get('admin::com.ninja.helper.default')->img('/48/' . KInflector::singularize($name) . '.png'); } if ($img) { KFactory::get('admin::com.ninja.helper.default')->css('.header.icon-48-' . $name . ' { background-image: url(' . $img . '); }'); } return KFactory::get($identifier, array('icon' => $name)); }
/** * Set the toolbar's title and icon * * @return string */ public function renderTitle() { $name = $this->getName(); $img = KInflector::isPLural($name) ? KFactory::get('admin::com.ninja.helper.default')->img('/48/' . $name . '.png') : KFactory::get('admin::com.ninja.helper.default')->img('/48/' . KInflector::pluralize($name) . '.png'); if (!$img) { $img = KInflector::isSingular($name) ? KFactory::get('admin::com.ninja.helper.default')->img('/48/' . $name . '.png') : KFactory::get('admin::com.ninja.helper.default')->img('/48/' . KInflector::singularize($name) . '.png'); } if ($img) { KFactory::get('admin::com.ninja.helper.default')->css('.header.icon-48-' . $name . ' { background-image: url(' . $img . '); }'); } $this->name = $this->getName(); $this->title = $this->_title; return $this->getTemplate()->loadIdentifier('admin::com.ninja.view.toolbar.toolbar_title', array('name' => $this->getName(), 'title' => $this->_title))->render(true); }