function checkOverride($filename, $type = 'css', $prefix = 'rdbs') { $mainframe = RdbsFactory::getApplication(); $template = $mainframe->getTemplate(); if (file_exists(SITEROOTDIR . DS . 'templates' . DS . $template . DS . $prefix . DS . $type . DS . $filename)) { return 'templates' . '/' . $template . '/' . $prefix . '/' . $type . '/' . $filename; } else { if (SITEROOTDIR . DS . 'media' . DS . $prefix . DS . $type . DS . $filename) { return 'media' . '/' . $prefix . '/' . $type . '/' . $filename; } } return false; }
/** * Constructor * @param $args * @return unknown_type */ function __construct($args = array()) { parent::__construct($args); // get the database handle from the model if (array_key_exists('db', $args)) { $this->db = $args['db']; } else { $this->db = $this->getDBO(); } // get the objname from the model if (array_key_exists('objname', $args)) { $this->objname = $args['objname']; } else { $this->objname = $this->getName(); } // get a appplication object $this->app = RdbsFactory::getApplication(); // get application name if (array_key_exists('scope', $args)) { $this->scope = $args['scope']; } else { $this->scope = $this->app->scope; } // set content if (array_key_exists('context', $args)) { $this->context = $args['context']; } else { $this->context = $this->scope . '.' . $this->objname . '.'; } // set tablename for model if (array_key_exists('table', $args)) { $this->table = $args['table']; } else { $this->table = '#__' . substr($this->scope, 4) . '_' . $this->objname; } }