public function run() { $config = new CConfiguration(Yii::app()->basePath . '/config/pager.php'); $form = new SearchForm(); // If referrer is not our action delete search parameters from session. if (strpos(Yii::app()->request->urlReferrer, '/site/search') === false) { Yii::app()->session->remove('siteSearch'); } else { if (!empty(Yii::app()->session['SearchForm'])) { $siteSearch = Yii::app()->session['SearchForm']; $form->text = $siteSearch['text']; $form->authorId = $siteSearch['authorId']; } } if (!empty($_POST['SearchForm']) && is_array($_POST['SearchForm'])) { $form->attributes = $_POST['SearchForm']; Yii::app()->session['SearchForm'] = array('text' => $form->text, 'authorId' => $form->authorId); } $criteria = new CDbCriteria(); $criteria->order = 'approvedTime DESC'; $criteria->condition = 'approvedTime AND (textRu LIKE :text OR textEn LIKE :text) ' . ($form->authorId ? 'AND (authorId LIKE :authorId)' : ''); $criteria->params = array(':text' => "%{$form->text}%") + ($form->authorId ? array(':authorId' => $form->authorId) : array()); $pages = new CPagination(Quote::model()->count($criteria)); $config->applyTo($pages); $pages->applyLimit($criteria); $quotes = Quote::model()->with('tags')->findAll($criteria); $criteria = new CDbCriteria(); $criteria->order = 'name'; $authors = Author::model()->findAll($criteria); $this->controller->render('search', array('quotes' => $quotes, 'pages' => $pages, 'form' => $form, 'authors' => $authors)); }
public function actionRun() { // get routines to upgrade $installedVersion = Yii::app()->params['version']; $addRoutines = false; $routines = array(); foreach ($this->history as $version) { if (!$addRoutines && $version[0] == $installedVersion) { $addRoutines = true; } if ($addRoutines && isset($version[1])) { $routines[] = $version[1]; } } // run upgrade routines foreach ($routines as $routine) { $this->{$routine}(); } // upgrade complete if ($addRoutines) { // write latest version to config $path = Yii::getPathOfAlias('application.config.ppma') . '.php'; /** @noinspection PhpIncludeInspection */ $config = new CConfiguration(require($path)); $config['version'] = $this->latestVersion; file_put_contents($path, "<?php\n\nreturn " . $config->saveAsString() . ';'); $this->render('success', array('version' => $this->latestVersion)); } else { $this->render('isuptodate'); } }
public function run() { $config = new CConfiguration(Yii::app()->basePath . '/config/pager.php'); $session = Yii::app()->session; $cookies = Yii::app()->request->cookies; // If referrer is not our action delete search parameters from session. if (strpos(Yii::app()->request->urlReferrer, '/tag/list') === false) { unset($session['search']); } if (!empty($_POST['search']) && is_array($_POST['search'])) { $search = $_POST['search']; $session['search'] = $search; } else { if (!empty($session['search'])) { $search = $session['search']; } else { $search = array('name' => ''); } } $criteria = new CDbCriteria(); $criteria->condition = 'name LIKE :name'; $criteria->params = array(':name' => "%{$search['name']}%"); $criteria->order = 'name'; $pages = new CPagination(Tag::model()->count($criteria)); $config->applyTo($pages); $pages->applyLimit($criteria); $tags = Tag::model()->with('quotesCount')->findAll($criteria); $showSearchForm = !empty($cookies['showSearchForm']) && $cookies['showSearchForm']->value ? true : false; $this->controller->render('list', array('tags' => $tags, 'pages' => $pages, 'search' => $search, 'showSearchForm' => $showSearchForm)); }
public function testException() { $config = new CConfiguration(array('invalid' => 'value')); $object = new MyClass(); $this->setExpectedException('CException'); $config->applyTo($object); }
public function run() { $session = Yii::app()->session; $config = new CConfiguration(Yii::app()->basePath . '/config/pager.php'); $cookies = Yii::app()->request->cookies; // If referrer is not our controller delete search parameters from session. if (strpos(Yii::app()->request->urlReferrer, '/quote/list') === false) { unset($session['search']); } if (!empty($_POST['search']) && is_array($_POST['search'])) { $search = $_POST['search']; $session['search'] = $search; } else { if (!empty($session['search'])) { $search = $session['search']; } else { $search = array('text' => '', 'authorId' => 0, 'approved' => 'all'); } } $criteria = new CDbCriteria(); $criteria->condition = '(textRu LIKE :text OR textEn LIKE :text) ' . ($search['authorId'] ? 'AND authorId = :authorId ' : '') . ($search['approved'] == 'approved' ? 'AND approvedTime ' : '') . ($search['approved'] == 'unApproved' ? 'AND (approvedTime IS NULL OR approvedTime = 0) ' : ''); $criteria->params = array(':text' => "%{$search['text']}%") + ($search['authorId'] ? array(':authorId' => $search['authorId']) : array()); $criteria->order = 'Quote.id DESC'; $pages = new CPagination(Quote::model()->count($criteria)); $config->applyTo($pages); $pages->applyLimit($criteria); $quotes = Quote::model()->with('tags', 'author')->findAll($criteria); $showSearchForm = !empty($cookies['showSearchForm']) && $cookies['showSearchForm']->value ? true : false; $criteria = new CDbCriteria(); $criteria->order = 'name'; $authors = Author::model()->findAll($criteria); $this->controller->render('list', array('quotes' => $quotes, 'pages' => $pages, 'authors' => $authors, 'search' => $search, 'showSearchForm' => $showSearchForm)); }
public function run() { $config = new CConfiguration(Yii::app()->basePath . '/config/pager.php'); $criteria = new CDbCriteria(); $criteria->order = 'approvedTime DESC'; $criteria->condition = 'approvedTime'; $pages = new CPagination(Quote::model()->count($criteria)); $config->applyTo($pages); $pages->applyLimit($criteria); $quotes = Quote::model()->with('tags', 'author')->findAll($criteria); $this->controller->render('list', array('quotes' => $quotes, 'pages' => $pages)); }
public function run() { $config = new CConfiguration(Yii::app()->basePath . '/config/pager.php'); $session = Yii::app()->session; $cookies = Yii::app()->request->cookies; $criteria = new CDbCriteria(); $criteria->order = 'name'; $pages = new CPagination(Author::model()->count($criteria)); $config->applyTo($pages); $pages->applyLimit($criteria); $authors = Author::model()->with('quotesCount')->findAll($criteria); $this->controller->render('list', array('authors' => $authors, 'pages' => $pages)); }
public function run() { $config = new CConfiguration(Yii::app()->basePath . '/config/pager.php'); $author = Author::model()->findByPk($_GET['authorId']); if ($author === null) { throw new CHttpException(404, 'Author not found'); } $criteria = new CDbCriteria(); $criteria->condition = 'authorId = :authorId'; $criteria->params = array(':authorId' => $author->id); $pages = new CPagination(Quote::model()->count($criteria)); $config->applyTo($pages); $pages->applyLimit($criteria); $quotes = Quote::model()->findAll($criteria); $this->controller->render('author', array('author' => $author, 'quotes' => $quotes, 'pages' => $pages)); }
static function send($destinataire) { $expediteur = CBdd::select_one("SELECT email FROM user WHERE type = 2", "email"); $id_texte = CConfiguration::get_valeur('WELCOME_TEXT_ID'); $sql_texte_select = "SELECT * FROM texte WHERE id = " . $id_texte; $texte = CBdd::select_row($sql_texte_select); $sql_user = "******" . $destinataire . "'"; $user = CBdd::select_row($sql_user); $message = str_replace('$NOM', $user['nom'], $texte['text']); $message = str_replace('$PRENOM', $user['prenom'], $message); //echo $message; $sujet = $texte['nom']; $sql_unicite_message = "SELECT id FROM email WHERE destinataire = '" . addslashes($destinataire) . "' AND nom = '" . addslashes($sujet) . "'"; // echo $sql_unicite_message; if(CBdd::select_one($sql_unicite_message, 'id')) { return 1; } $sql_email_insert = "INSERT INTO email(expediteur, destinataire, nom, text, etat) VALUES ('" . addslashes($expediteur) . "', '" . addslashes($destinataire) . "', '" . addslashes($sujet) . "', '" . addslashes($message) . "', '2')"; CBdd::insert($sql_email_insert); return CMail::send_mail($destinataire, CFonction::force_stripslashes($sujet), CFonction::force_stripslashes($message), $expediteur, array(), 'Bcc: ' . $expediteur); }
function get_href($zone, $id, $cle = '') { $zone = $zone[0]; $url = "index.php?cle=" . CFonction::formate_chaine($cle)."&" . $zone . "=" . $id; if(CConfiguration::get_valeur('REWRITE_ENGINE') == 'on') { $url = preg_replace('/^(.*)(cle=)(.*)(&)(p|s|m)(=)([0-9]*)$/', '$3_$5$7.html', $url); } return $url; }
public function __construct($name, $runner) { //non conflicting alias $alias = md5(__DIR__); Yii::setPathOfAlias($alias, __DIR__); //configuring $configPath = Yii::getPathOfAlias($alias . '.configs'); $config = new CConfiguration(array('alias' => $alias)); $config->loadFromFile($configPath . '/stdConfig.php'); //base config if ($this->config) { $config->loadFromFile($configPath . '/' . $this->config . '.php'); } foreach ($config as $key => $val) { $this->{$key} = $val; } //do import Yii::import($alias . '.*', true); Yii::import($alias . '.iterators.*', true); //set translaitor Yii::app()->setComponent('docBlockMessage', Yii::createComponent($this->messageSource)); parent::__construct($name, $runner); }
function is_oop_on($trace = false) { static $s_oopIsEnabled; if (isset($s_oopIsEnabled)) { // Return the cached value. return $s_oopIsEnabled; } if (CConfiguration::isInitialized()) { $s_oopIsEnabled = CConfiguration::appOption("enableOop"); return $s_oopIsEnabled; } else { return false; } }
/** * Get the config values for an object or for all objects * * @param string $object_guid The object to get config values of * * @return array|mixed The config values */ static function getValues($object_guid) { static $dirty = null; // Check values status, only once per request if ($dirty === null && self::getValuesCacheStatus() === self::STATUS_DIRTY) { self::refreshDataCache(); $dirty = false; } // Check if all the keys exist if (empty(self::$hosts)) { $hosts = SHM::get("config-values-__HOSTS__"); if (empty($hosts)) { self::refreshDataCache(); } else { self::$hosts = $hosts["content"]; } } // For a single host if (empty(self::$values[$object_guid])) { $_values = SHM::get("config-values-{$object_guid}"); self::$values[$object_guid] = $_values["content"]; } return self::$values[$object_guid]; }
CAppUI::stepAjax("module-system-msg-cache-removal", UI_MSG_OK, $count, $_class); } // Remove configuration model if (!SHM::get("config-model")) { CAppUI::stepAjax("ConfigModel-shm-none", UI_MSG_OK); } else { if (!SHM::rem("config-model")) { CAppUI::stepAjax("ConfigModel-shm-rem-ko", UI_MSG_WARNING); } CAppUI::stepAjax("ConfigModel-shm-rem-ok", UI_MSG_OK); } // Remove configuration values if (!SHM::get("config-values-__HOSTS__")) { CAppUI::stepAjax("ConfigValues-shm-none", UI_MSG_OK); } else { CConfiguration::clearDataCache(); CAppUI::stepAjax("ConfigValues-shm-rem-ok", UI_MSG_OK); } /////////// CSS cache $css_files = glob("tmp/*.css"); foreach ($css_files as $_css_file) { unlink($_css_file); } CAppUI::stepAjax("CSS-cache-ok", UI_MSG_OK, count($css_files)); /////////// JavaScript cache $js_files = glob("tmp/*.js"); foreach ($js_files as $_js_file) { unlink($_js_file); } CAppUI::stepAjax("JS-cache-ok", UI_MSG_OK, count($js_files)); ////////// Smarty templates
//} ////////// Configuration model $cache_status = CConfiguration::getModelCacheStatus(); switch ($cache_status) { case "empty": CAppUI::stepAjax("ConfigModel-shm-none", UI_MSG_OK); break; case "dirty": CAppUI::stepAjax("ConfigModel-shm-ko", UI_MSG_WARNING); break; case "ok": CAppUI::stepAjax("ConfigModel-shm-ok", UI_MSG_OK); break; } ////////// Configuration values $cache_status = CConfiguration::getValuesCacheStatus(); switch ($cache_status) { case "empty": CAppUI::stepAjax("ConfigValues-shm-none", UI_MSG_OK); break; case "dirty": CAppUI::stepAjax("ConfigValues-shm-ko", UI_MSG_WARNING); break; case "ok": CAppUI::stepAjax("ConfigValues-shm-ok", UI_MSG_OK); break; } // Smarty templates $templates = glob("tmp/templates_c/*/*"); CAppUI::stepAjax("template-cache-ok", UI_MSG_OK, count($templates)); // Module specific checkings
public function __construct($config = NULL) { $config = new CConfiguration($config); $config->applyTo($this); }
<?php /** * $Id: configuration.php 28921 2015-07-09 09:22:11Z flaviencrochard $ * * @category dPhospi * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 28921 $ * @link http://www.mediboard.org */ CConfiguration::register(array("CGroups" => array("dPhospi" => array("CAffectation" => array("create_affectation_tolerance" => "num min|2 max|120 default|2", "sejour_default_affectation" => "bool default|0"), "vue_tableau" => array("show_labo_results" => "bool default|1"), "vue_temporelle" => array("infos_interv" => "bool default|0"), "prestations" => array("systeme_prestations" => "enum list|standard|expert default|standard"))), "CService CGroups.group_id" => array("dPhospi" => array("vue_temporelle" => array("hour_debut_day" => "num min|0 max|23 default|0", "hour_fin_day" => "num min|0 max|23 default|23", "show_imc_patient" => "bool default|0")))));
/** * Returns the name of the application's default locale. * * @return CUStringObject The name of the application's default locale. */ public static function defaultLocaleName() { return CConfiguration::appOption("defaultLocale"); }
<?php /** * $Id$ * * @category Admin * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ * @link http://www.mediboard.org */ CConfiguration::register(array("CGroups" => array("admin" => array("CBrisDeGlace" => array("enable_bris_de_glace" => "bool default|0"), "CLogAccessMedicalData" => array("enable_log_access" => "bool default|0", "round_datetime" => "enum list|1m|10m|1h|1d default|1h localize")))));
/** * @see parent::store() */ function store() { $is_new = !$this->_id; if ($msg = parent::store()) { return $msg; } if ($is_new) { CConfiguration::clearDataCache(); if (CModule::getActive("dPprescription")) { CConfigService::emptySHM(); CConfigMomentUnitaire::emptySHM(); } } return null; }
public function loadFromFile($configFile) { return parent::loadFromFile($this->getFullAlias($configFile)); }
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ $object_guid = CValue::get("object_guid"); $module = CValue::get("module"); $inherit = CValue::get("inherit"); $uid = CValue::get("uid"); $object = null; if ($object_guid && $object_guid != "global") { $object = CMbObject::loadFromGuid($object_guid); $configs = CConfiguration::getClassConfigs($object->_class, $module, $inherit); } else { if (!CAppUI::$user->isAdmin()) { global $can; $can->redirect(); return; } $model = CConfiguration::getModuleConfigs($module, $inherit); $configs = array(); foreach ($model as $_model) { $configs = array_merge($configs, $_model); } } $ancestor_configs = CConfiguration::getAncestorsConfigs($inherit, array_keys($configs), $object); $smarty = new CSmartyDP(); $smarty->assign("ancestor_configs", $ancestor_configs); $smarty->assign("object_guid", $object_guid); $smarty->assign("configs", $configs); $smarty->assign("inherit", $inherit); $smarty->assign("uid", $uid); $smarty->display("inc_edit_object_config.tpl");
<?php /** * $Id$ * * @package Mediboard * @subpackage ccam * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ * @link http://www.mediboard.org */ CConfiguration::register(array('CGroups' => array('dPccam' => array('codage' => array('rights' => 'enum list|user_rights|self localize default|user_rights'), 'associations' => array('mode' => 'enum list|auto|manual localize default|auto', 'rules' => array('M' => 'bool default|1', 'G' => 'bool default|1', 'EA' => 'bool default|1', 'EB' => 'bool default|1', 'EC' => 'bool default|1', 'ED' => 'bool default|1', 'EE' => 'bool default|1', 'EF' => 'bool default|1', 'EG1' => 'bool default|1', 'EG2' => 'bool default|1', 'EG3' => 'bool default|1', 'EG4' => 'bool default|1', 'EG5' => 'bool default|1', 'EG6' => 'bool default|1', 'EG7' => 'bool default|1', 'EH' => 'bool default|1', 'EI' => 'bool default|1'))))));
function load_img($imgname, $mwidth, $mheight) { // Longueur maximum prédéfinis en configuration if($largeur_max=='') { $max_width = CConfiguration::get_valeur('IMG_MAX_WIDTH'); } // Hauteur maximum prédéfinis en configuration if($hauteur_max=='') { $max_height = CConfiguration::get_valeur('IMG_MAX_HEIGHT'); } $im = imagecreatetruecolor($mwidth, $mheight); /* Création d'une image blanche */ $bgc = imagecolorallocate($im, 51, 51, 51); imagefilledrectangle($im, 0, 0, $mwidth, $mheight, $bgc); $source = imagecreatefromjpeg($imgname); // Calcul des nouvelles dimensions list($width, $height) = getimagesize($imgname); $tab = self::width_height_img_formate($imgname, $mwidth, $mheight); $nwidth = $tab['width']; $nheight = $tab['height']; imagecopyresized($im, $source, 0, 0, 0, 0, $nwidth, $nheight, $width, $height); return $im; }
public function __construct($parent, $config = NULL) { $this->setParent($parent); $config = new CConfiguration($config); $config->applyTo($this); }
else if ( $_SERVER['REQUEST_METHOD'] == "POST" ) { $a = @$_POST["a"]; if(!empty($_POST['order'])) $order = $_POST['order']; else $order = @$_SESSION['order']; } // SESSION VARIABLE if (isset($_GET['alphaA'])) $_SESSION['alphaA'] = $_GET['alphaA']; // RECUPERATION VALEUR $zSortField = 'id' ; $zSortDirection = CFunctions::getUserParam('zSortDirection', 'ASC') ; $pagecourant = CFunctions::getUserParam('zSortField', '0') ; $iCurrentPage = CFunctions::getUserParam('iPage', '1') ; $iMaxPerPage = CConfiguration::get_valeur('MAX_ITEM_PER_PAGE', 10) ; $iStart = $iCurrentPage - 1 ; //COMPTEUR D'ENREGISTREMENT $i = CTableGroupeUtilitaire::get_iNbrContact($_SESSION['groupe']); $iMaxPerPage1 = $i-1; // FIN COMPTEUR $iNbPage = ceil(($iMaxPerPage1/$iMaxPerPage)) ; $zListeGetParam = '' ; /*-------------------------------------------------------------------- TRAITEMENTS ----------------------------------------------------------------------*/
/** * @ignore */ public static function onThirdPartyUpdateByPackageManager() { if (!self::isInCliMode()) { // This method can be run in CLI mode only. assert('false', vs(isset($this), get_defined_vars())); } $timeoutPause = new CTimeoutPause(); CShell::speak("Processing third-party components ..."); $tpDps = CFile::listDirectories(CFilePath::absolute($GLOBALS["PHRED_PATH_TO_THIRD_PARTY"])); $ignorePackages = CConfiguration::option("upd.thirdPartyOopWrappingIgnorePackages"); $ignorePackagesL2 = CArray::filter($ignorePackages, function ($package) { return CString::find($package, "/"); }); $newTpDps = CArray::make(); $len = CArray::length($tpDps); for ($i = 0; $i < $len; $i++) { $tpDp = $tpDps[$i]; $dirName = CFilePath::name($tpDp); if (!CArray::find($ignorePackages, $dirName)) { $dpHasL2DirsToIgnore = CArray::find($ignorePackagesL2, $dirName, function ($packageL2, $dirName) { return CString::equals(CFilePath::directory($packageL2), $dirName); }); if (!$dpHasL2DirsToIgnore) { CArray::push($newTpDps, $tpDp); } else { $tpSubDps = CFile::listDirectories($tpDp); $tpSubDps = CArray::filter($tpSubDps, function ($subDp) use($ignorePackagesL2) { return !CArray::find($ignorePackagesL2, $subDp, function ($packageL2, $subDp) { return CString::endsWith($subDp, $packageL2); }); }); CArray::pushArray($newTpDps, $tpSubDps); } } } $tpDps = $newTpDps; $wrapProtectedMethods = CConfiguration::option("upd.thirdPartyOopWrappingInProtectedMethods"); $wrapPrivateMethods = CConfiguration::option("upd.thirdPartyOopWrappingInPrivateMethods"); static $s_stdPhpTag = "<?php"; static $s_progressResolution = 0.05; $prevProgressDivR = 0; $tpDpsLen = CArray::length($tpDps); for ($i0 = 0; $i0 < $tpDpsLen; $i0++) { $tpFps = CFile::reFindFilesRecursive($tpDps[$i0], "/\\.php\\d?\\z/"); $tpFpsLen = CArray::length($tpFps); for ($i1 = 0; $i1 < $tpFpsLen; $i1++) { $fileCode = CFile::read($tpFps[$i1]); if (!CString::find($fileCode, self::$ms_thirdPartyAlreadyOopWrappedMark)) { $parser = new PhpParser\Parser(new PhpParser\Lexer()); try { // Parse the code. $statements = $parser->parse($fileCode); // Wrap the code into OOP. $traverser = new PhpParser\NodeTraverser(); $mainVisitor = new CMainVisitor($wrapProtectedMethods, $wrapPrivateMethods); $traverser->addVisitor($mainVisitor); $statements = $traverser->traverse($statements); $wrappedCode = (new PhpParser\PrettyPrinter\Standard())->prettyPrint($statements); $phpTagPos = CString::indexOf($wrappedCode, $s_stdPhpTag); if ($phpTagPos == -1) { $wrappedCode = "{$s_stdPhpTag}\n\n{$wrappedCode}"; $phpTagPos = 0; } $wrappedCode = CString::insert($wrappedCode, $phpTagPos + CString::length($s_stdPhpTag), "\n\n" . self::$ms_thirdPartyAlreadyOopWrappedMark); // Save. CFile::write($tpFps[$i1], $wrappedCode); } catch (PhpParser\Error $parserError) { CShell::say("\nPhpParser: " . $tpFps[$i1] . ", at line " . $parserError->getRawLine() . ": " . $parserError->getRawMessage()); } } $progress = (double) ($i0 / $tpDpsLen + 1 / $tpDpsLen * $i1 / $tpFpsLen); $progressDivR = CMathi::floor($progress / $s_progressResolution); if ($progressDivR != $prevProgressDivR) { $perc = CMathi::round($progressDivR * $s_progressResolution * 100); CShell::speak("{$perc}%"); } $prevProgressDivR = $progressDivR; } } CShell::speak("100%"); CShell::say("Done."); $timeoutPause->end(); }
* * @package Mediboard * @subpackage Patients * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ $selection = array("poids" => "custom tpl|inc_config_constant components|form|graph|color|mode|min|max|norm_min|norm_max default|1|0|0066FF|float|2|2|0|0", "taille" => "custom tpl|inc_config_constant components|form|graph|color|mode|min|max|norm_min|norm_max default|2|0|0066FF|float|5|5|0|0", "pouls" => "custom tpl|inc_config_constant components|form|graph|color|mode|min|max|norm_min|norm_max default|3|1|FF0000|fixed|70|120|0|0", "temperature" => "custom tpl|inc_config_constant components|form|graph|color|mode|min|max|norm_min|norm_max default|4|1|0066FF|fixed|36|40|37.5|0", "ta" => "custom tpl|inc_config_constant components|form|graph|color|mode|min|max|norm_min|norm_max default|5|1|000000|fixed|2|16|8|12", "EVA" => "custom tpl|inc_config_constant components|form|graph|color|mode|min|max|norm_min|norm_max default|6|1|FF00FF|fixed|0|10|0|0", "frequence_respiratoire" => "custom tpl|inc_config_constant components|form|graph|color|mode|min|max|norm_min|norm_max default|7|1|009900|fixed|0|60|0|0"); foreach (CConstantesMedicales::$list_constantes as $_constante => $_params) { if (!isset($_params["cumul_for"]) && !in_array($_constante, array('poids', 'taille', 'pouls', 'temperature', 'ta', 'EVA', 'frequence_respiratoire'))) { $mode = 'fixed'; $min = $_params['min']; $max = $_params['max']; $norm_min = 0; $norm_max = 0; if (strpos($_params['min'], '@') !== false || strpos($_params['max'], '@') !== false) { $mode = 'float'; $min = str_replace('@-', '', $_params['min']); $max = str_replace('@+', '', $_params['max']); } if (array_key_exists('norm_min', $_params)) { $norm_min = $_params['norm_min']; } if (array_key_exists('norm_max', $_params)) { $norm_max = $_params['norm_max']; } $selection[$_constante] = "custom tpl|inc_config_constant components|form|graph|color|mode|min|max|norm_min|norm_max default|0|0|0066FF|{$mode}|{$min}|{$max}|{$norm_min}|{$norm_max}"; } } CConfiguration::register(array('CGroups' => array('dPpatients' => array('CPatient' => array('mode_identito_vigilance' => "enum list|light|medium|strict localize default|light", 'nom_jeune_fille_mandatory' => "bool default|0", 'allow_anonymous_patient' => "bool default|0", 'anonymous_naissance' => "str default|1970-01-01", 'anonymous_sexe' => "enum list|m|f default|m", 'manage_identity_status' => "bool default|0", 'auto_selected_patient' => "bool default|0", 'default_value_allow_sms' => "bool default|0"), 'identitovigilance' => array('merge_only_admin' => "bool default|0", 'show_patient_link' => "bool default|0"), 'CTraitement' => array('enabled' => "bool default|0"), 'CAntecedent' => array('show_form_add_atcd' => 'bool default|0'))), 'constantes / CGroups' => array('dPpatients' => array('CConstantesMedicales' => array('unite_ta' => 'enum list|cmHg|mmHg default|' . CAppUI::conf('dPpatients CConstantesMedicales unite_ta'), 'unite_glycemie' => 'enum list|g/l|mmol/l default|' . CAppUI::conf('dPpatients CConstantesMedicales unite_glycemie'), 'unite_cetonemie' => 'enum list|g/l|mmol/l default|' . CAppUI::conf('dPpatients CConstantesMedicales unite_cetonemie'), 'unite_hemoglobine' => 'enum list|g/dl|g/l default|g/dl'))), "constantes / CService CGroups.group_id" => array("dPpatients" => array("CConstantesMedicales" => array("show_cat_tabs" => "bool default|0", "show_enable_all_button" => "bool default|1", "constants_modif_timeout" => "num min|0 max|48 default|12", "stacked_graphs" => "bool default|0", 'graphs_display_mode' => 'custom tpl|inc_config_graphs_display_mode components|mode|time default|classic|8', "diuere_24_reset_hour" => "num min|0 max|23 default|8", "redon_cumul_reset_hour" => "num min|0 max|23 default|8", "redon_accordeon_cumul_reset_hour" => "num min|0 max|23 default|8", "sng_cumul_reset_hour" => "num min|0 max|23 default|8", "lame_cumul_reset_hour" => "num min|0 max|23 default|8", "drain_cumul_reset_hour" => "num min|0 max|23 default|8", "drain_thoracique_cumul_reset_hour" => "num min|0 max|23 default|8", "drain_pleural_cumul_reset_hour" => "num min|0 max|23 default|8", "drain_mediastinal_cumul_reset_hour" => "num min|0 max|23 default|8", "drain_dve_cumul_reset_hour" => "num min|0 max|23 default|8", "drain_kher_cumul_reset_hour" => "num min|0 max|23 default|8", "drain_crins_cumul_reset_hour" => "num min|0 max|23 default|8", "drain_sinus_cumul_reset_hour" => "num min|0 max|23 default|8", "drain_orifice_cumul_reset_hour" => "num min|0 max|23 default|8", "drain_ileostomie_cumul_reset_hour" => "num min|0 max|23 default|8", "drain_colostomie_cumul_reset_hour" => "num min|0 max|23 default|8", "drain_gastrostomie_cumul_reset_hour" => "num min|0 max|23 default|8", "drain_jejunostomie_cumul_reset_hour" => "num min|0 max|23 default|8", "sonde_ureterale_cumul_reset_hour" => "num min|0 max|23 default|8", "sonde_nephro_cumul_reset_hour" => "num min|0 max|23 default|8", "sonde_vesicale_cumul_reset_hour" => "num min|0 max|23 default|8", "sonde_rectale_cumul_reset_hour" => "num min|0 max|23 default|8", 'urine_effective_24_reset_hour' => 'num min|o max|23 default|8', "selection" => $selection))), "constantes / CFunctions CGroups.group_id" => array("dPpatients" => array("CConstantesMedicales" => array("show_cat_tabs" => "bool default|0", "stacked_graphs" => "bool default|0", "selection_cabinet" => $selection))), "constantes / CBlocOperatoire CGroups.group_id" => array("dPpatients" => array("CConstantesMedicales" => array("show_cat_tabs" => "bool default|0", "stacked_graphs" => "bool default|0", "selection_bloc" => $selection)))));
<?php /** * $Id:$ * * @category PlanningOp * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision:$ * @link http://www.mediboard.org */ CConfiguration::register(array("CGroups" => array("dPplanningOp" => array("CSejour" => array("pass_to_confirm" => "bool default|0", 'entree_pre_op_ambu' => 'bool default|0', 'use_charge_price_indicator' => 'enum list|no|opt|obl localize default|no', "required_destination" => "bool default|0", "required_from_when_transfert" => "bool default|0", "required_mode_entree" => "bool default|0", "required_uf_soins" => "enum list|no|opt|obl localize default|no", "ssr_not_collides" => "bool default|0", "use_phone" => "bool default|0"), "COperation" => array("multiple_label" => "bool default|0")))));
/** * Load the configuration array. * * @return array */ protected function getConfiguration() { $configData = null; $configPathAlias = $this->configPathAlias; if ($this->allowSelectConfig && isset($_GET['config'])) { $configData = Yii::getPathOfAlias($configPathAlias . '.' . $_GET['config']) . '.php'; } if (empty($configData)) { $configData = empty($this->config) ? $configPathAlias . '.' . $this->defaultConfig : $this->config; if (is_string($configData)) { $configData = Yii::getPathOfAlias($configData) . '.php'; } } if (empty($configData) || !is_file($configData)) { $this->logError('No valid configuration found.'); return false; } $config = new CConfiguration($configData); if (empty($config)) { $this->logError('Invalid configuration.'); return false; } return $config->toArray(); }