id: 45 name: cmp.actionfile.php category: MyComponent properties: null ----- modx->getOption('mc_packageNameLower.core_path', NULL, $this->modx->getOption('core_path') . 'components/mc_packageNameLower/') . 'model/mc_packageNameLower/'; require_once $path . 'mc_packageNameLower.class.php'; $this->mc_packageNameLower = new mc_packageName($this->modx); /* Optional alternative - install PHP class as a service */ /* $this->mc_packageNameLower = $this->modx->getService('mc_packageNameLower', 'mc_packageName', $path);*/ /* Add the main javascript class and our configuration */ $this->addJavascript($this->mc_packageNameLower->config['jsUrl'] . 'mc_packageNameLower.class.js'); $this->addHtml(''); } /** * Defines the lexicon topics to load in our controller. * * @return array */ public function getLanguageTopics() { return array('mc_packageNameLower:default'); } /** * We can use this to check if the user has permission to see this * controller. We'll apply this in the admin section. * * @return bool */ public function checkPermissions() { return true; } /** * The name for the template file to load. * * @return string */ public function getTemplateFile() { return dirname(__FILE__) . '/templates/mgr.tpl'; // return $this->mc_packageNameLower->config['templatesPath'] . 'mgr.tpl'; } } /** * The Index Manager Controller is the default one that gets called when no * action is present. */ class IndexManagerController extends mc_packageNameManagerController { /** * Defines the name or path to the default controller to load. * * @return string */ public static function getDefaultController() { return 'home'; } }