本文整理汇总了PHP中CMbArray类的典型用法代码示例。如果您正苦于以下问题:PHP CMbArray类的具体用法?PHP CMbArray怎么用?PHP CMbArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CMbArray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFormHtmlElement
/**
* @see parent::getFormHtmlElement()
*/
function getFormHtmlElement($object, $params, $value, $className)
{
$maxLength = 10;
CMbArray::defaultValue($params, "size", $maxLength);
CMbArray::defaultValue($params, "maxlength", $maxLength);
return $this->getFormElementText($object, $params, $value, $className);
}
示例2: fillOtherSegments
/**
* Fill other identifiers
*
* @param array &$data Datas
* @param array $ufs UF
* @param CHL7v2Event $event Event
*
* @return null
*/
function fillOtherSegments(&$data, $ufs = array(), CHL7v2Event $event)
{
// ZBE-8: Ward of care responsibility in the period starting with this movement (XON) (optional)
$uf_type = $event->_receiver->_configs["build_ZBE_8"];
/** @var CUniteFonctionnelle $uf_soins */
$uf_soins = isset($ufs[$uf_type]) ? $ufs[$uf_type] : null;
if (isset($uf_soins->_id)) {
$data[] = array(array($uf_soins->libelle, null, null, null, null, $this->getAssigningAuthority("mediboard"), "UF", null, null, $uf_soins->code));
} else {
$data[] = null;
}
// ZBE-9: Nature of this movement (CWE)
// S - Changement de responsabilité de soins uniquement
// H - Changement de responsabilité d'hébergement soins uniquement
// M - Changement de responsabilité médicale uniquement
// L - Changement de lit uniquement
// D - Changement de prise en charge médico-administrative laissant les responsabilités et la localisation du patient inchangées
// (ex : changement de tarif du séjour en unité de soins)
// SM - Changement de responsabilité soins + médicale
// SH - Changement de responsabilité soins + hébergement
// MH - Changement de responsabilité hébergement + médicale
// LD - Changement de prise en charge médico-administrative et de lit, laissant les responsabilités inchangées
// HMS - Changement conjoint des trois responsabilités.
/* @todo Voir comment gérer ceci... */
// Changement d'UF médicale
if (CMbArray::in($event->code, "Z80 Z81 Z82 Z83")) {
$data[] = "M";
} elseif (CMbArray::in($event->code, "Z84 Z85 Z86 Z87")) {
$data[] = "S";
} else {
$data[] = "HMS";
}
}
示例3: getSymbolChar
/**
* Get an HTML representation of the symbol char
*
* @return string The HTML symbol char
*/
function getSymbolChar()
{
$this->completeField("symbol", "show_points", "display");
if (!$this->show_points && $this->display != "points") {
return null;
}
return CMbArray::get(self::$_symbol_chars, $this->symbol);
}
示例4: getNameClass
/**
* Retourne le nom de la classe
*
* @return mixed|string
*/
function getNameClass()
{
$name = get_class($this);
$name = substr($name, 4);
if (get_class($this) === "CCDA_base_cs") {
$name = CMbArray::get(explode("_", $name), 1);
}
return $name;
}
示例5: getFormHtmlElement
/**
* @see parent::getFormHtmlElement()
*/
function getFormHtmlElement($object, $params, $value, $className)
{
$field = CMbString::htmlSpecialChars($this->fieldName);
$value = CMbString::htmlSpecialChars($value);
$class = CMbString::htmlSpecialChars("{$className} {$this->prop}");
$form = CMbArray::extract($params, "form");
$extra = CMbArray::makeXmlAttributes($params);
return "<input type=\"tel\" name=\"{$field}\" value=\"{$value}\" class=\"{$class} styled-element\" {$extra} />";
}
示例6: updateFormFields
/**
* @see parent::updateFormFields()
*/
function updateFormFields()
{
$this->_query_params_get = $get = json_decode($this->query_params_get, true);
$this->_query_params_post = $post = json_decode($this->query_params_post, true);
$this->_session_data = $session = json_decode($this->session_data, true);
$get = is_array($get) ? $get : array();
$post = is_array($post) ? $post : array();
$this->_module = CValue::first(CMbArray::extract($get, "m"), CMbArray::extract($post, "m"));
$this->_action = CValue::first(CMbArray::extract($get, "tab"), CMbArray::extract($get, "a"), CMbArray::extract($post, "dosql"));
}
示例7: getSpecWithClassName
/**
* Returns a spec object for an object's field from a class name
*
* @param string $class The class name
* @param string $field The field name
* @param string $prop The prop string serializing the spec object options
*
* @throws Exception
* @return CMbFieldSpec
*/
static function getSpecWithClassName($class, $field, $prop)
{
$spec_class = "CMbFieldSpec";
// Get Spec type
$first_space = strpos($prop, " ");
$spec_type = $first_space === false ? $prop : substr($prop, 0, $first_space);
// Get spec class
if ($spec_type && null == ($spec_class = CMbArray::get(self::$classes, $spec_type))) {
throw new Exception("Invalid spec '{$prop}' for field '{$class}::{$field}'");
}
return new $spec_class($class, $field, $prop);
}
示例8: deleteContentAndUpdateExchange
/**
* Delete content and update exchange
*
* @param CContentTabular $content_tabular Content tabular
* @param int $type_content_id Content ID
* @param date $date_max Date max
* @param int $max Max exchange
*
* @return int
*/
function deleteContentAndUpdateExchange(CContentTabular $content_tabular, $type_content_id, $date_max, $max)
{
$ds = $content_tabular->_spec->ds;
// Récupère les content Tabulé
$query = "SELECT cx.content_id\r\n FROM content_tabular AS cx, exchange_hl7v2 AS ec\r\n WHERE ec.`date_production` < '{$date_max}'\r\n AND ec.{$type_content_id} = cx.content_id\r\n LIMIT {$max};";
$ids = CMbArray::pluck($ds->loadList($query), "content_id");
// Suppression du contenu Tabulé
$query = "DELETE FROM content_tabular\r\n WHERE content_id " . CSQLDataSource::prepareIn($ids);
$ds->exec($query);
// Mise à jour des échanges
$query = "UPDATE exchange_hl7v2\r\n SET `{$type_content_id}` = NULL \r\n WHERE `{$type_content_id}` " . CSQLDataSource::prepareIn($ids);
$ds->exec($query);
$count = $ds->affectedRows();
return $count;
}
示例9: getValue
/**
* @see parent::getValue()
*/
function getValue($object, $smarty = null, $params = array())
{
if ($smarty) {
include_once $smarty->_get_plugin_filepath('modifier', 'date_format');
}
$propValue = $object->{$this->fieldName};
$format = CMbArray::extract($params, "format", CAppUI::conf("datetime"));
if ($format === "relative") {
$relative = CMbDate::relative($propValue, CMbDT::dateTime());
return $relative["count"] . " " . CAppUI::tr($relative["unit"] . ($relative["count"] > 1 ? "s" : ""));
}
$date = CMbArray::extract($params, "date");
if ($date && CMbDT::date($propValue) == $date) {
$format = CAppUI::conf("time");
}
return $propValue && $propValue != "0000-00-00 00:00:00" ? smarty_modifier_date_format($propValue, $format) : "";
}
示例10: addAudiogramme
function addAudiogramme($values, $value_name, $title, $mark_color, $mark_type, $mark_file = null, $line = true)
{
$frequences = CExamAudio::$frequences;
$root = CAppUI::conf("root_dir");
$image_file = "{$root}/images/icons/{$mark_file}";
// Empty plot case
$datay = $values;
CMbArray::removeValue("", $datay);
if (!count($datay)) {
return;
}
$words = explode(" ", $this->title->t);
$cote = $words[1];
$labels = array();
$jscalls = array();
// Remove empty values to connect distant points
$datax = array();
$datay = array();
foreach ($values as $key => $value) {
if ($value !== "" && $value !== null) {
$frequence = $frequences[$key];
$jstitle = strtr($title, "\n", " ");
$labels[] = "Modifier la valeur {$value}dB pour {$jstitle} à {$frequence}";
$jscalls[] = "javascript:changeTonalValue('{$cote}','{$value_name}',{$key})";
$datay[] = -intval($value);
$datax[] = "{$key}";
// Needs to be a string when null
}
}
$p1 = new LinePlot($datay, $datax);
$p1->mark->SetType($mark_type, $image_file, 1.0);
$this->Add($p1);
// Create the first line
$p1->SetColor($mark_color);
$p1->SetCenter();
$p1->SetLegend($title);
$p1->SetWeight($line ? 1 : -10);
$p1->SetCSIMTargets($jscalls, $labels);
// Marks
$p1->mark->SetColor($mark_color);
$p1->mark->SetFillColor("{$mark_color}@0.6");
$p1->mark->SetWidth(4);
}
示例11: update
function update($newValues = array(), $keepOld = true)
{
$newValues = array_map_recursive('stripslashes', $newValues);
if ($keepOld) {
$this->load();
$newValues = CMbArray::mergeRecursive($this->values, $newValues);
}
if (!count($newValues)) {
if (is_file($this->targetPath)) {
unlink($this->targetPath);
}
return;
}
$this->values = $newValues;
// Throws many E_STRICT errors
$config = @new Config();
@$config->parseConfig($this->values, $this->configType, $this->options);
return @$config->writeConfig($this->targetPath, $this->configType, $this->options);
}
示例12: loadAllSalutations
/**
* Load all salutation from a given class
*
* @param string $object_class Target object class
* @param integer|null $object_id Target object ID
* @param int $perm Permission needed on owners
* @param integer|null $owner_id Specific owner ID
*
* @return CSalutation[]
*/
static function loadAllSalutations($object_class, $object_id = null, $perm = PERM_EDIT, $owner_id = null)
{
if (!$owner_id) {
$users = new CMediusers();
$users = $users->loadListWithPerms($perm, array('actif' => "= '1'"));
$user_ids = $users ? CMbArray::pluck($users, '_id') : array(CMediusers::get()->_id);
unset($users);
} else {
$user_ids = array($owner_id);
}
/** @var CSalutation $salutation */
$salutation = new self();
$ds = $salutation->_spec->ds;
$where = array('owner_id' => $ds->prepareIn($user_ids), 'object_class' => $ds->prepare('= ?', $object_class));
if ($object_id) {
$where['object_id'] = $ds->prepare('= ?', $object_id);
}
return $salutation->loadList($where);
}
示例13: build
/**
* Build event
*
* @param CMbObject $object Object
*
* @see parent::build()
*
* @return void
*/
function build($object)
{
// Traitement sur le mbObject
$this->object = $object;
$this->last_log = $object->loadLastLog();
// Récupération de la version HL7 en fonction du receiver et de la transaction
$this->version = CAppUI::conf("hl7 default_version");
if ($version = CMbArray::get($this->_receiver->_configs, $this->transaction . "_HL7_version")) {
$this->version = $version;
}
// Génération de l'échange
$this->generateExchange();
$terminator = $this->getSegmentTerminator($this->_receiver->_configs["ER7_segment_terminator"]);
// Création du message HL7
$message = new CHL7v2Message($this->version);
$message->segmentTerminator = $terminator;
$message->name = $this->msg_codes;
$this->message = $message;
}
示例14: getFormHtmlElement
/**
* @see parent::getFormHtmlElement()
*/
function getFormHtmlElement($object, $params, $value, $className)
{
$field = CMbString::htmlSpecialChars($this->fieldName);
$form = CMbArray::extract($params, "form");
$extra = CMbArray::makeXmlAttributes($params);
$readonly = CMbArray::extract($params, "readonly");
$default_color = $this->default ? $this->default : "ffffff";
$reset_value = $this->notNull ? $default_color : "";
$bg_reset = $reset_value ? "#{$reset_value}" : "transparent";
$value = !$value && ($this->notNull || $this->default) ? $default_color : $value;
$sHtml = "\n <input type=\"text\" class=\"color_picker\" name=\"{$field}\" value=\"{$value}\" {$extra} />\n <button type=\"button\" onclick=\"var elem = \$(this).previous('input'); \$V(elem, '{$reset_value}', true); elem.setStyle({backgroundColor: '{$bg_reset}'});\" class='cancel notext'></button>\n ";
if ($form && !$readonly) {
$js_params = "{}";
if (!$this->notNull) {
$js_params = "{required:false}";
}
$sHtml .= "<script type=\"text/javascript\">\n Main.add(function(){\n var _e = getForm('" . $form . "').elements['" . $field . "'];\n new jscolor.color(_e, {$js_params});\n })\n </script>";
}
return $sHtml;
}
示例15: addAudiogramme
function addAudiogramme($values, $mark_color)
{
$pressions = CExamAudio::$pressions;
// Empty plot case
$datay = $values;
CMbArray::removeValue("", $datay);
if (!count($datay)) {
return;
}
$title = $this->title->t;
$words = explode(" ", $title);
$cote = $words[1];
$labels = array();
$jscalls = array();
// Remove empty values to connect distant points
$datax = array();
$datay = array();
foreach ($values as $key => $value) {
if ($value !== "" && $value !== null) {
$pression = $pressions[$key];
$jstitle = strtr($title, "\n", " ");
$labels[] = "Modifier l'admittance {$value} ml pour {$jstitle} à la pression {$pression} mm H²0";
$jscalls[] = "javascript:changeTympanValue('{$cote}',{$key})";
$datay[] = $value;
$datax[] = "{$key}";
// Needs to be a string when null
}
}
$p1 = new LinePlot($datay, $datax);
// Create the first line
$p1->SetColor($mark_color);
$p1->SetCenter();
$p1->SetWeight(1);
$p1->SetCSIMTargets($jscalls, $labels);
// Marks
$p1->mark->SetType(MARK_FILLEDCIRCLE);
$p1->mark->SetColor($mark_color);
$p1->mark->SetFillColor("{$mark_color}@0.6");
$p1->mark->SetWidth(4);
$this->Add($p1);
}