public function fetchElement($name, $value, &$node, $control_name)
 {
     $config = array('name' => $control_name . '[' . $name . ']', 'selected' => $value, 'deselect' => false);
     $template = Library\ObjectManager::getInstance()->getObject('com:pages.view.page')->getTemplate();
     $html = Library\ObjectManager::getInstance()->getObject('com:articles.template.helper.listbox', array('template' => $template))->searchpages($config);
     return $html;
 }
示例#2
0
 public function fetchElement($name, $value, &$node, $control_name)
 {
     $config = array('name' => $control_name . '[' . $name . ']', 'selected' => $value, 'table' => $node->attributes('table'), 'attribs' => array('class' => 'inputbox'));
     $template = Library\ObjectManager::getInstance()->getObject('com:pages.view.page')->getTemplate();
     $html = Library\ObjectManager::getInstance()->getObject('com:categories.template.helper.listbox', array('template' => $template))->categories($config);
     return $html;
 }
示例#3
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     $config = array('name' => $control_name . '[' . $name . ']', 'selected' => $value, 'table' => $node->attributes('table'), 'attribs' => array('class' => 'inputbox'), 'autocomplete' => true);
     $template = Library\ObjectManager::getInstance()->getObject('com:contacts.controller.contact')->getView()->getTemplate();
     $html = Library\ObjectManager::getInstance()->getObject('com:contacts.template.helper.listbox', array('template' => $template))->contacts($config);
     return $html;
 }
 function fetchElement($name, $value, &$node, $control_name)
 {
     $user = Library\ObjectManager::getInstance()->getObject('user');
     if (!($user->getRole() >= 23) && $node->attributes('client') == 'administrator') {
         return JText::_('No Access');
     }
     return Library\ObjectManager::getInstance()->getObject('com:users.template.helper.listbox')->languages(array('selected' => $value, 'application' => $node->attributes('client'), 'name' => $control_name . '[' . $name . ']'));
 }
示例#5
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     $template = Library\ObjectManager::getInstance()->getObject('com:pages.view.page')->getTemplate();
     $class = $node->attributes('class') ? $node->attributes('class') : 'inputbox';
     $helper = Nooku\Library\ObjectManager::getInstance()->getObject('lib:template.helper.select', array('template' => $template));
     $options = array();
     foreach ($node->children() as $option) {
         $options[] = $helper->option(array('value' => $option->attributes('value'), 'text' => $option->data()));
     }
     $config = array('options' => $options, 'name' => $control_name . '[' . $name . ']', 'selected' => $value, 'attribs' => array('class' => array($class)));
     return Nooku\Library\ObjectManager::getInstance()->getObject('lib:template.helper.select', array('template' => $template))->optionlist($config);
 }
示例#6
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     $options = array();
     foreach ($node->children() as $option) {
         $val = $option->attributes('value');
         $text = $option->data();
         $options[] = (object) array('id' => $val, 'value' => $val, 'label' => JText::_($text));
     }
     $config = array('options' => (object) $options, 'name' => $control_name . '[' . $name . ']', 'selected' => $value);
     $template = Library\ObjectManager::getInstance()->getObject('com:pages.view.page')->getTemplate();
     return Nooku\Library\ObjectManager::getInstance()->getObject('lib:template.helper.select', array('template' => $template))->radiolist($config);
 }
示例#7
0
 function fetchElement($name, $value, &$node = null, $control_name = null, $show_root = true)
 {
     $el_name = $control_name ? $control_name . '[' . $name . ']' : $name;
     $show_root = $node->attributes('show_root');
     $tree = Library\ObjectManager::getInstance()->getObject('com:files.controller.folder')->container('files-files')->tree(1)->limit(0)->browse();
     $options = array();
     if ($show_root) {
         $options[] = array('text' => JText::_('Root Folder'), 'value' => '');
     }
     foreach ($tree as $folder) {
         $this->_addFolder($folder, $options);
     }
     return Library\ObjectManager::getInstance()->getObject('com:files.template.helper.select')->optionlist(array('name' => $el_name, 'options' => $options, 'showroot' => false, 'selected' => $value));
 }
 * Framework loader
 *
 * @author      Johan Janssens <http://nooku.assembla.com/profile/johanjanssens>
 */
use Nooku\Library;
//Installation check
if (!file_exists(JPATH_ROOT . '/config/config.php') || filesize(JPATH_ROOT . '/config/config.php') < 10) {
    echo 'No configuration file found. Exciting...';
    exit;
}
// Joomla : setup
require_once JPATH_VENDOR . '/joomla/import.php';
jimport('joomla.environment.uri');
jimport('joomla.html.html');
jimport('joomla.html.parameter');
jimport('joomla.utilities.utility');
jimport('joomla.language.language');
// Koowa : setup
require_once JPATH_ROOT . '/config/config.php';
$config = new JConfig();
require_once JPATH_ROOT . '/library/nooku.php';
\Nooku::getInstance(array('cache_prefix' => md5($config->secret) . '-cache-koowa', 'cache_enabled' => $config->caching));
unset($config);
//Setup the component locator
Library\ClassLoader::getInstance()->getLocator('com')->registerNamespaces(array('\\' => JPATH_APPLICATION . '/component', 'Nooku\\Component' => JPATH_ROOT . '/component'));
//Add the different applications
Library\ClassLoader::getInstance()->addApplication('site', JPATH_ROOT . '/application/site');
Library\ClassLoader::getInstance()->addApplication('admin', JPATH_ROOT . '/application/admin');
//Bootstrap the components
Library\ObjectManager::getInstance()->getObject('lib:bootstrapper.application', array('directory' => JPATH_APPLICATION . '/component'))->bootstrap();
示例#9
0
                print ProgressBar::next();
            }
        }
        unset($levels, $date_min, $date_max, $i, $row, $created, $level, $parent_id);
        print ProgressBar::finish();
        print "DONE\r\n\n";
    }
}
// Generate articles.
if ($numbers['articles']) {
    ProgressBar::start($numbers['articles']);
    ProgressBar::setMessage('Adding articles...');
    $date_min = new DateTime('-3 years');
    $date_max = new DateTime();
    for ($i = 0; $i < $numbers['articles']; $i++) {
        $row = Library\ObjectManager::getInstance()->getObject('com:articles.model.articles')->getItem();
        $row->title = $generator->words(pick_random(range(1, 5)));
        $row->introtext = $generator->sentences(pick_random(range(1, 3)));
        $row->fulltext = $generator->sentences(pick_random(range(0, 5)));
        $row->published = (int) (rand(0, 20) > 0);
        $row->categories_category_id = pick_random($categories['articles']);
        $created = new DateTime('@' . rand($date_min->format('U'), $date_max->format('U')));
        $row->created_on = $created->format('Y-m-d H:i:s');
        $row->created_by = pick_random($users);
        $row->save();
        print ProgressBar::next();
    }
    unset($date_min, $date_max, $i, $row, $created);
    print ProgressBar::finish();
    print "DONE\r\n\n";
}