/** * create a mapper object or return null * * @param BaseObject $obj * @param $fieldName * @return base_mapper_BaseObject|null */ public static function createObject($class, $fieldName) { foreach (base_infrastructure_Folder::getFilesFromFolder('modules') as $module) { $className = "{$module}_mapper_" . strtolower($class) . "_" . ucfirst(str_replace('_', '', $fieldName)); try { if (class_exists($className)) { return new $className(); } } catch (Exception $e) { } } return null; }
/** * get all scripts * * @return string */ public function getScripts() { $jsFiles = base_infrastructure_Folder::getFilesFromFolder('js'); $this->addJavaScript(HTML_ROOT . '/modules/base/extlib/jquery-2.1.3.min.js'); $this->addJavaScript(HTML_ROOT . '/modules/base/extlib/jquery-form.js'); $this->addJavaScript(HTML_ROOT . '/modules/base/extlib/jquery-validate.min.js'); $this->addJavaScript(HTML_ROOT . '/modules/base/extlib/jquery-ui/jquery-ui.min.js'); $this->addJavaScript(HTML_ROOT . '/modules/base/extlib/jquery-multiselect/js/ui.multiselect.js'); $this->addJavaScript(HTML_ROOT . '/modules/base/extlib/jqGrid/src/i18n/grid.locale-de.js'); $this->addJavaScript(HTML_ROOT . '/modules/base/extlib/jqGrid/js/jquery.jqGrid.min.js'); foreach ($jsFiles as $file) { $this->addJavaScript(HTML_ROOT . '/js/' . $file); } return implode("\n\t\t", $this->scripts); }
public function copyJS(OutputDevice $od) { foreach (base_infrastructure_Folder::getFilesFromFolder('modules') as $module) { if ($module == 'Custom' || !file_exists(ROOT . "/modules/$module/root/js")) { continue; } foreach (base_infrastructure_Folder::getFilesFromFolder("modules/$module/root/js") as $jsFileToCopy) { if (copy(ROOT . "/modules/$module/root/js/$jsFileToCopy", ROOT . "/js/$jsFileToCopy")) { base_install_Message::printOut("----- Die Datei '/modules/$module/root/js/$jsFileToCopy' wurde erfolgreich kopiert -----", $od); } } } if (!is_dir(ROOT . '/modules/Custom/root/js')) { return; } foreach (base_infrastructure_Folder::getFilesFromFolder("modules/Custom/root/js") as $jsFileToCopy) { if (copy(ROOT . "/modules/Custom/root/js/$jsFileToCopy", ROOT . "/js/$jsFileToCopy")) { base_install_Message::printOut("----- Die Datei '/modules/Custom/root/js/$jsFileToCopy' wurde erfolgreich kopiert -----", $od); } } }
* Date: 22.01.2015 * Time: 14:57 */ require_once dirname(dirname(dirname(dirname(__DIR__)))) . '/config.php'; $od = new OutputDevice(); base_ui_Site::displayHead($od); base_ui_Site::displayTop($od); base_ui_Site::displayNavigation($od); base_ui_Site::startMainContent($od); $od->addContent(Html::startTag('h3')); $od->addContent('Leeren des Caches'); $od->addContent(Html::endTag('h3')); $rmdir = base_infrastructure_Folder::rmdirRecursive(ROOT . '/files/cache'); $mkdir = mkdir(ROOT . '/files/cache'); if ($rmdir == base_infrastructure_Folder::DELETE_FOLDER_SUCCESS && $mkdir) { $od->addContent('Der Cache wurde erfolgreich gelöscht'); } else { $od->addContent('Beim Cache leeren sind Probleme aufgetreten. Bitte wenden Sie sich an den Administrator'); } base_ui_Site::endMainContent($od); base_ui_Site::displayBottom($od); print $od->toString();