public static function registerCSS($includeCSS) { if (is_string($includeCSS)) { $includeCSS = [$includeCSS]; } if (!empty($includeCSS)) { foreach ($includeCSS as $css) { $path = Asset::resolveAlias($css); if (is_file($path . ".css")) { $file = $path . ".css"; if (strpos($file, Setting::getRootPath()) === 0) { $file = substr($file, strlen(Setting::getRootPath())); $file = Yii::app()->baseUrl . $file; } Yii::app()->clientScript->registerCssFile($file); continue; } $csspath = realpath($path); if (is_dir($csspath)) { $path = Asset::publish($csspath); $files = glob($csspath . "/*"); foreach ($files as $p) { if (pathinfo($p, PATHINFO_EXTENSION) != "css") { continue; } $p = str_replace($csspath, '', realpath($p)); Yii::app()->clientScript->registerCssFile($path . str_replace("\\", "/", $p)); } } else { if (is_file($csspath)) { Yii::app()->clientScript->registerCssFile(Asset::publish($csspath)); } } } } }
public static function getAssetPath() { return Setting::getRootPath() . DIRECTORY_SEPARATOR . "assets"; }
"; $scope.modelBaseClass = "<?php echo ActiveRecord::baseClass($this->model); ?> "; $scope.lastModified = "<?php echo Helper::getLastModified($modelClass); ?> "; $scope.date = date; $scope.strtotime = strtotime; $scope.angular = angular; if (window.plansys) { window.plansys.rootPath = "<?php echo Setting::getRootPath(); ?> "; window.plansys.baseUrl = "<?php echo Yii::app()->baseUrl; ?> "; } // Process Relation Error Message for (i in $scope.errors) { if ($scope.errors[i].length > 0 && angular.isObject($scope.errors[i][0])) { var err = []; var error = $scope.errors[i][0]; if (!error.type || !error.list) continue;
public static function init($config) { ## we hare to make sure the error page is shown ## so we need to strip yii unneeded config to make sure it is running $config['defaultController'] = "install"; $config['components']['errorHandler'] = ['errorAction' => 'install/default/index']; Installer::checkInstall(); if (Setting::$mode == "init") { $url = preg_replace('/\\/?plansys\\/?$/', '', Setting::fullPath()); if (is_file(Setting::getRootPath() . DIRECTORY_SEPARATOR . "index.php")) { header("Location: " . $url . "/index.php"); die; } if (!Installer::createIndexFile()) { Setting::redirError("Failed to write in \"{path}\" <br/> Permission denied", ['{path}' => Setting::getRootPath() . DIRECTORY_SEPARATOR . "index.php"]); return $config; } else { header("Location: " . $url . "/index.php?r=install/default/index"); die; } } return $config; }
"; $scope.lastModified = "<?php echo Helper::getLastModified($modelClass); ?> "; $scope.date = date; $scope.strtotime = strtotime; $scope.angular = angular; if (window.plansys) { window.plansys.rootPath = "<?php echo Setting::getRootPath(); ?> "; window.plansys.repoPath = "<?php echo Setting::getRootPath() . DIRECTORY_SEPARATOR . Setting::get('repo.path'); ?> "; window.plansys.baseUrl = "<?php echo Yii::app()->baseUrl; ?> "; } // Process Relation Error Message for (i in $scope.errors) { if ($scope.errors[i].length > 0 && angular.isObject($scope.errors[i][0])) { var err = []; var error = $scope.errors[i][0]; if (!error.type || !error.list) continue;
"; $scope.lastModified = "<?php echo Helper::getLastModified($modelClass); ?> "; $scope.date = date; $scope.strtotime = strtotime; $scope.angular = angular; if (window.plansys) { window.plansys.rootPath = '<?php echo str_replace("\\", "/", Setting::getRootPath()); ?> '; window.plansys.repoPath = '<?php echo str_replace("\\", "/", Setting::getRootPath() . DIRECTORY_SEPARATOR . Setting::get("repo.path")); ?> '; window.plansys.baseUrl = "<?php echo Yii::app()->baseUrl; ?> "; } // Process Relation Error Message for (i in $scope.errors) { if ($scope.errors[i].length > 0 && angular.isObject($scope.errors[i][0])) { var err = []; var error = $scope.errors[i][0]; if (!error.type || !error.list) continue;
public function __construct() { if (Setting::get("repo.path") == '') { $path = Setting::getRootPath() . DIRECTORY_SEPARATOR . 'repo'; Setting::set("repo.path", $path); $this->repoPath = Setting::get("repo.path"); } else { $this->repoPath = Setting::get("repo.path"); } }