Example #1
0
 private function getHelper($helper)
 {
     $helperPlural = Ntentan::plural($helper);
     $helper = $helperPlural == null ? $helper : $helperPlural;
     if ($helper === null) {
         return false;
     }
     if (!isset($this->loadedHelpers[$this->plugin . $helper])) {
         $camelizedHelper = Ntentan::camelize($helper) . "Helper";
         $helperFile = Ntentan::$modulesPath . "/helpers/{$helper}/{$camelizedHelper}.php";
         if (file_exists($helperFile)) {
             require_once $helperFile;
             $helperClass = "\\" . Ntentan::$namespace . "\\helpers\\{$helper}\\{$camelizedHelper}";
         } else {
             if ($this->pluginMode) {
                 $path = Ntentan::getPluginPath("{$this->plugin}/helpers/{$helper}");
                 Ntentan::addIncludePath("{$this->plugin}");
                 $helperClass = "\\ntentan\\plugins\\{$this->plugin}\\helpers\\{$helper}\\{$camelizedHelper}";
             } else {
                 if (file_exists(Ntentan::getFilePath("lib/views/helpers/{$helper}"))) {
                     $path = Ntentan::getFilePath("lib/views/helpers/{$helper}");
                     $helperClass = "\\ntentan\\views\\helpers\\{$helper}\\{$camelizedHelper}";
                 } else {
                     return false;
                 }
             }
         }
         Ntentan::addIncludePath($path);
         $helperInstance = new $helperClass();
         $this->loadedHelpers[$this->plugin . $helper] = $helperInstance;
     }
     return $this->loadedHelpers[$this->plugin . $helper];
 }
Example #2
0
 public function init()
 {
     parent::init();
     $this->addComponent('wyf.model_controller');
     $wyf = $this->wyfModelControllerComponent;
     $wyf->listFields = array('firstname', 'lastname', 'username');
     $wyf->addOperation('Assign Roles', 'assign_roles');
     TemplateEngine::appendPath(Ntentan::getPluginPath('wyf/views/system_module'));
 }
Example #3
0
 public function init()
 {
     parent::init();
     $this->addComponent('wyf.model_controller');
     $wyf = $this->wyfModelControllerComponent;
     $wyf->addOperation('Set Permissions', 'set_permissions');
     $wyf->listFields = array('name', 'description');
     TemplateEngine::appendPath(Ntentan::getPluginPath('wyf/views/system_module'));
 }
Example #4
0
 public static function getClassFile($class)
 {
     $key = "file_{$class}";
     if (Cache::exists($key)) {
         $classFile = Cache::get($key);
     } else {
         $fullPath = explode("\\", $class);
         //Get rid of any initial empty class name
         if ($fullPath[0] == "") {
             array_shift($fullPath);
         }
         $class = array_pop($fullPath);
         if ($fullPath[0] == \ntentan\Ntentan::$namespace) {
             $basePath = Ntentan::$appHome . '/' . implode("/", $fullPath);
         } else {
             if ($fullPath[0] == 'ntentan' && $fullPath[1] == "plugins") {
                 array_shift($fullPath);
                 array_shift($fullPath);
                 $basePath = \ntentan\Ntentan::getPluginPath(implode("/", $fullPath));
             } else {
                 if ($fullPath[0] == 'ntentan' && $fullPath[1] == "dev") {
                     array_shift($fullPath);
                     array_shift($fullPath);
                     $basePath = NTENTAN_DEV_HOME . '/' . implode("/", $fullPath);
                 } else {
                     if ($fullPath[0] == 'ntentan') {
                         array_shift($fullPath);
                         $basePath = \ntentan\Ntentan::getFilePath('lib/' . implode("/", $fullPath));
                     }
                 }
             }
         }
         $classFile = $basePath . '/' . $class . '.php';
         Cache::add($key, $classFile);
     }
     return $classFile;
 }
 public function init()
 {
     TemplateEngine::appendPath(Ntentan::getPluginPath('wyf/views/report_controller'));
 }
Example #6
0
function p($path)
{
    return Ntentan::getPluginPath($path);
}