本文整理汇总了PHP中CAppUI类的典型用法代码示例。如果您正苦于以下问题:PHP CAppUI类的具体用法?PHP CAppUI怎么用?PHP CAppUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CAppUI类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: setUserMailHash
/**
* Set the hash for the user mails
*
* @return bool
*/
protected function setUserMailHash()
{
$ds = CSQLDataSource::get("std");
$mails = $ds->loadList("SELECT m.user_mail_id, m.account_class, m.account_id, m.from, m.to, m.subject, c.content FROM user_mail as m, content_html as c WHERE m.account_class IS NOT NULL AND m.account_id IS NOT NULL AND m.text_html_id = c.content_id ORDER BY m.user_mail_id DESC;");
if (count($mails)) {
$values = array();
foreach ($mails as $_mail) {
$data = "==FROM==\n" . $_mail['from'] . "\n==TO==\n" . $_mail['to'] . "\n==SUBJECT==\n" . $_mail['subject'] . "\n==CONTENT==\n" . $_mail['content'];
$hash = CMbSecurity::hash(CMbSecurity::SHA256, $data);
$values[] = '(' . $_mail['user_mail_id'] . ', ' . $_mail['account_id'] . ', \'' . $_mail['account_class'] . "', '{$hash}')";
}
$mails = $ds->loadList("SELECT m.user_mail_id, m.account_class, m.account_id, m.from, m.to, m.subject, c.content FROM user_mail AS m, content_any AS c WHERE m.account_class IS NOT NULL AND m.account_id IS NOT NULL AND m.text_html_id IS NULL AND m.text_plain_id = c.content_id ORDER BY m.user_mail_id DESC;");
foreach ($mails as $_mail) {
$data = "==FROM==\n" . $_mail['from'] . "\n==TO==\n" . $_mail['to'] . "\n==SUBJECT==\n" . $_mail['subject'] . "\n==CONTENT==\n" . $_mail['content'];
$hash = CMbSecurity::hash(CMbSecurity::SHA256, $data);
$values[] = '(' . $_mail['user_mail_id'] . ', ' . $_mail['account_id'] . ', \'' . $_mail['account_class'] . "', '{$hash}')";
}
$query = "INSERT INTO `user_mail` (`user_mail_id`, `account_id`, `account_class`, `hash`) VALUES " . implode(', ', $values) . " ON DUPLICATE KEY UPDATE `hash` = VALUES(`hash`);";
$ds->query($query);
if ($msg = $ds->error()) {
CAppUI::stepAjax($msg, UI_MSG_WARNING);
return false;
}
}
return true;
}
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:31,代码来源:setup.php
示例2: remove
public function remove(CAppUI $AppUI, w2p_Utilities_Date $date)
{
$perms = $AppUI->acl();
$removed = false;
if ($this->holiday_id && $perms->checkModuleItem('holiday', 'edit', $this->holiday_id)) {
$holiday_start_date = new w2p_Utilities_Date($this->holiday_start_date);
$holiday_end_date = new w2p_Utilities_Date($this->holiday_end_date);
if ($holiday_start_date->equals($date->duplicate())) {
if ($holiday_end_date->equals($date->duplicate())) {
$removed = $this->delete($AppUI);
} else {
$holiday_start_date = new w2p_Utilities_Date($this->holiday_start_date);
$this->holiday_start_date = $holiday_start_date->getNextDay()->getDate();
$removed = $this->store($AppUI);
}
} elseif ($holiday_end_date->equals($date->duplicate())) {
$holiday_end_date = new w2p_Utilities_Date($this->holiday_end_date);
$this->holiday_end_date = $holiday_end_date->getPrevDay()->getDate();
$removed = $this->store($AppUI);
} elseif ($holiday_start_date->before($date->duplicate()) && $holiday_end_date->after($date->duplicate())) {
$holiday_end_date = $this->holiday_end_date;
$this->holiday_end_date = $date->getPrevDay()->getDate();
$removed = $this->store($AppUI);
$this->holiday_id = 0;
// create new record
$this->holiday_start_date = $date->getNextDay()->getDate();
$this->holiday_end_date = $holiday_end_date;
$removed = $this->store($AppUI);
}
}
return $removed;
}
开发者ID:Raithlin,项目名称:web2project-holiday,代码行数:32,代码来源:holiday.class.php
示例3: store
public function store(CAppUI $AppUI)
{
$perms = $AppUI->acl();
$stored = false;
$errorMsgArray = $this->check();
if (count($errorMsgArray) > 0) {
return $errorMsgArray;
}
/*
* TODO: I don't like the duplication on each of these two branches, but I
* don't have a good idea on how to fix it at the moment...
*/
if ($this->field_id && canEdit('system')) {
if ($msg = parent::store()) {
return $msg;
}
$stored = true;
}
if (0 == $this->field_id && canEdit('system')) {
if ($msg = parent::store()) {
return $msg;
}
$stored = true;
}
return $stored;
}
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:26,代码来源:CustomFieldManager.class.php
示例4: store
public function store(CAppUI $AppUI)
{
$perms = $AppUI->acl();
$stored = false;
$this->file_folder_id = (int) $this->file_folder_id;
$this->file_folder_parent = (int) $this->file_folder_parent;
$this->_error = $this->check();
if (count($this->_error)) {
return $this->_error;
}
/*
* TODO: I don't like the duplication on each of these two branches, but I
* don't have a good idea on how to fix it at the moment...
*/
if ($this->file_folder_id && $perms->checkModuleItem('files', 'edit')) {
if ($msg = parent::store()) {
return $msg;
}
$stored = true;
}
if (0 == $this->file_folder_id && $perms->checkModuleItem('files', 'add')) {
if ($msg = parent::store()) {
return $msg;
}
$stored = true;
}
return $stored;
}
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:28,代码来源:filefolder.class.php
示例5: process
public function process(CAppUI $AppUI, array $myArray)
{
if (!$this->object->bind($myArray)) {
$AppUI->setMsg($this->object->getError(), UI_MSG_ERROR);
$this->resultPath = $this->errorPath;
return $AppUI;
}
$action = $this->delete ? 'deleted' : 'stored';
$this->success = $this->delete ? $this->object->delete($AppUI) : $this->object->store($AppUI);
if (is_array($this->success) || !$this->success) {
$AppUI->holdObject($this->object);
/*
* TODO: This nasty structure was introduced in v3.0 and is only
* transitional while the individual modules are updated to
* stop using $this->success as both a boolean and the error array.
* -- This was due to a bad design decision on my part. -caseydk
*/
if (is_array($this->object->getError())) {
$AppUI->setMsg($this->object->getError(), UI_MSG_ERROR);
} else {
$AppUI->setMsg($this->success, UI_MSG_ERROR);
}
$this->resultPath = $this->errorPath;
return $AppUI;
}
if ($this->success) {
$AppUI->setMsg($this->prefix . ' ' . $action, UI_MSG_OK, true);
$this->resultPath = $this->successPath;
} else {
$this->resultPath = $this->accessDeniedPath;
}
return $AppUI;
}
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:33,代码来源:Base.class.php
示例6: renderColumn
public static function renderColumn(CAppUI $AppUI, $fieldName, $row)
{
switch ($fieldName) {
case 'project_creator':
case 'project_owner':
$s .= '<td nowrap="nowrap">';
$s .= w2PgetUsernameFromID($row[$fieldName]);
$s .= '</td>';
break;
case 'project_target_budget':
case 'project_actual_budget':
$s .= '<td>';
$s .= $w2Pconfig['currency_symbol'];
$s .= formatCurrency($row[$fieldName], $AppUI->getPref('CURRENCYFORM'));
$s .= '</td>';
break;
case 'project_url':
case 'project_demo_url':
$s .= '<td>';
$s .= w2p_url($row[$fieldName]);
$s .= '</td>';
break;
case 'project_start_date':
case 'project_end_date':
$df = $AppUI->getPref('SHDATEFORMAT');
$myDate = intval($row[$fieldName]) ? new w2p_Utilities_Date($row[$fieldName]) : null;
$s .= '<td nowrap="nowrap" class="center">' . ($myDate ? $myDate->format($df) : '-') . '</td>';
break;
default:
$s .= '<td nowrap="nowrap" class="center">';
$s .= htmlspecialchars($row[$fieldName], ENT_QUOTES);
$s .= '</td>';
}
return $s;
}
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:35,代码来源:HTMLHelper.class.php
示例7: remove
public function remove(CAppUI $AppUI = null)
{
global $AppUI;
$q = new w2p_Database_Query();
$q->dropTable('history');
$q->exec();
$perms = $AppUI->acl();
return $perms->unregisterModule('history');
}
开发者ID:eureka2,项目名称:web2project,代码行数:9,代码来源:setup.php
示例8: delete
public function delete(CAppUI $AppUI)
{
$perms = $AppUI->acl();
$this->_error = array();
if ($perms->checkModuleItem('resources', 'delete', $this->resource_id)) {
if ($msg = parent::delete()) {
return $msg;
}
return true;
}
return false;
}
开发者ID:eureka2,项目名称:web2project,代码行数:12,代码来源:resources.class.php
示例9: checkProtection
/**
* Check anti-CSRF protection
*/
static function checkProtection()
{
if (!CAppUI::conf("csrf_protection") || strtoupper($_SERVER['REQUEST_METHOD']) != 'POST') {
return;
}
if (!isset($_POST["csrf"])) {
CAppUI::setMsg("CCSRF-no_token", UI_MSG_ERROR);
return;
}
if (array_key_exists($_POST['csrf'], $_SESSION["tokens"])) {
$token = $_SESSION['tokens'][$_POST['csrf']];
if ($token["lifetime"] >= time()) {
foreach ($token["fields"] as $_field => $_value) {
if (CValue::read($_POST, $_field) != $_value) {
CAppUI::setMsg("CCSRF-form_corrupted", UI_MSG_ERROR);
unset($_SESSION['tokens'][$_POST['csrf']]);
return;
}
}
//mbTrace("Le jeton est accepté !");
unset($_SESSION['tokens'][$_POST['csrf']]);
} else {
CAppUI::setMsg("CCSRF-token_outdated", UI_MSG_ERROR);
unset($_SESSION['tokens'][$_POST['csrf']]);
}
return;
}
CAppUI::setMsg("CCSRF-token_does_not_exist", UI_MSG_ERROR);
return;
}
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:33,代码来源:CCSRF.class.php
示例10: __construct
/**
* @see parent::__construct
*/
function __construct()
{
$this->evenement = "evt_serveurintervention";
$this->acquittement = "acquittementsServeurActes";
$version = str_replace(".", "", CAppUI::conf("hprimxml {$this->evenement} version"));
parent::__construct("serveurActivitePmsi_v{$version}", "msgAcquittementsServeurActes{$version}");
}
开发者ID:fbone,项目名称:mediboard4,代码行数:10,代码来源:CHPrimXMLAcquittementsServeurIntervention.class.php
示例11: mine
static function mine($parent_class)
{
$classes = CApp::getChildClasses($parent_class);
$limit = CAppUI::conf("dataminer_limit");
foreach ($classes as $_class) {
$miner = new $_class();
$report = $miner->mineSome($limit, "mine");
$dt = CMbDT::dateTime();
echo "<{$dt}> Miner: {$_class}. Success mining count is '" . $report["success"] . "'\n";
if (!$report["failure"]) {
echo "<{$dt}> Miner: {$_class}. Failure mining counts is '" . $report["failure"] . "'\n";
}
$miner = new $_class();
$report = $miner->mineSome($limit, "remine");
$dt = CMbDT::dateTime();
echo "<{$dt}> Reminer: {$_class}. Success remining count is '" . $report["success"] . "'\n";
if (!$report["failure"]) {
echo "<{$dt}> Reminer: {$_class}. Failure remining counts is '" . $report["failure"] . "'\n";
}
$miner = new $_class();
$report = $miner->mineSome($limit, "postmine");
$dt = CMbDT::dateTime();
echo "<{$dt}> Postminer: {$_class}. Success postmining count is '" . $report["success"] . "'\n";
if (!$report["failure"]) {
echo "<{$dt}> Postminer: {$_class}. Failure postmining counts is '" . $report["failure"] . "'\n";
}
}
}
开发者ID:fbone,项目名称:mediboard4,代码行数:28,代码来源:CDataMinerWorker.class.php
示例12: onAfterStore
/**
* @see parent::onAfterStore()
*/
function onAfterStore(CMbObject $mbObject)
{
if (!$this->isHandled($mbObject)) {
return false;
}
/** @var CConsultation $consultation */
$consultation = $mbObject;
$praticien = $consultation->loadRefPraticien();
if (!$praticien || $praticien && !$praticien->_id) {
return false;
}
$function = $praticien->loadRefFunction();
if (!$function || $function && !$function->_id) {
return false;
}
$functions = CAppUI::conf("ihe RAD-3 function_ids");
$functions = explode("|", $functions);
if (!in_array($function->_id, $functions)) {
return false;
}
$code = "O01";
if (!$this->isMessageSupported($this->transaction, $this->message, $code, $consultation->_receiver)) {
return false;
}
$this->sendITI($this->profil, $this->transaction, $this->message, $code, $consultation);
return true;
}
开发者ID:fbone,项目名称:mediboard4,代码行数:30,代码来源:CRAD3DelegatedHandler.class.php
示例13: logForSejour
/**
* logSejourAccess
*
* @param CSejour $sejour
*
* @return bool has the access been logged
*/
static function logForSejour($sejour)
{
$group = $sejour->loadRefEtablissement();
if (!CAppUI::conf("admin CLogAccessMedicalData enable_log_access", $group) || !$sejour->_id) {
return false;
}
$user = CMediusers::get();
$conf = CAppUI::conf("admin CLogAccessMedicalData round_datetime", $group);
$datetime = CMbDT::dateTime();
switch ($conf) {
case '1m':
// minute
$datetime = CMbDT::format($datetime, "%y-%m-%d %H:%M:00");
break;
case '10m':
// 10 minutes
$minute = CMbDT::format($datetime, "%M");
$minute = str_pad(floor($minute / 10) * 10, 2, 0, STR_PAD_RIGHT);
$datetime = CMbDT::format($datetime, "%y-%m-%d %H:{$minute}:00");
break;
case '1d':
// 1 day
$datetime = CMbDT::format($datetime, "%y-%m-%d 00:00:00");
break;
default:
// 1 hour
$datetime = CMbDT::format($datetime, "%y-%m-%d %H:00:00");
break;
}
return self::logintoDb($user->_id, $sejour->_class, $sejour->_id, $datetime, $group->_id);
}
开发者ID:fbone,项目名称:mediboard4,代码行数:38,代码来源:CLogAccessMedicalData.class.php
示例14: generateEnteteMessageAcquittement
/**
* @see parent::generateEnteteMessageAcquittement()
*/
function generateEnteteMessageAcquittement($statut, $codes = null, $commentaires = null)
{
$echg_hprim = $this->_ref_echange_hprim;
$identifiant = $echg_hprim->_id ? str_pad($echg_hprim->_id, 6, '0', STR_PAD_LEFT) : "ES{$this->now}";
$acquittementsServeurActivitePmsi = $this->addElement($this, $this->acquittement, null, "http://www.hprim.org/hprimXML");
$this->addAttribute($acquittementsServeurActivitePmsi, "version", CAppUI::conf("hprimxml {$this->evenement} version"));
$enteteMessageAcquittement = $this->addElement($acquittementsServeurActivitePmsi, "enteteMessage");
$this->addAttribute($enteteMessageAcquittement, "statut", $statut);
$this->addElement($enteteMessageAcquittement, "identifiantMessage", $identifiant);
$this->addDateTimeElement($enteteMessageAcquittement, "dateHeureProduction");
$emetteur = $this->addElement($enteteMessageAcquittement, "emetteur");
$agents = $this->addElement($emetteur, "agents");
$this->addAgent($agents, "application", "MediBoard", "Gestion des Etablissements de Santé");
$group = CGroups::loadCurrent();
$group->loadLastId400();
$this->addAgent($agents, $this->getAttSysteme(), CAppUI::conf('mb_id'), $group->text);
$echg_hprim->loadRefsInteropActor();
// Pour un acquittement l'emetteur du message devient destinataire
$destinataire = $this->addElement($enteteMessageAcquittement, "destinataire");
$agents = $this->addElement($destinataire, "agents");
$this->addAgent($agents, "application", $echg_hprim->_ref_sender->nom, $echg_hprim->_ref_sender->libelle);
/* @todo Doit-on gérer le système du destinataire ? */
//$this->addAgent($agents, "système", $group->_id, $group->text);
$this->addElement($enteteMessageAcquittement, "identifiantMessageAcquitte", $this->_identifiant_acquitte);
}
开发者ID:fbone,项目名称:mediboard4,代码行数:28,代码来源:CHPrimXMLAcquittementsServeurActivitePmsi.class.php
示例15: mbAutoload
/**
* Mediboard class autoloader
*
* @param string $class Class to be loaded
*
* @return bool
*/
function mbAutoload($class)
{
$file_exists = false;
$time = microtime(true);
// Entry already in cache
if (isset(CApp::$classPaths[$class])) {
// The class is known to not be in MB
if (CApp::$classPaths[$class] === false) {
return false;
}
// Load it if we can
if ($file_exists = file_exists(CApp::$classPaths[$class])) {
CApp::$performance["autoloadCount"]++;
return include_once CApp::$classPaths[$class];
}
}
// File moved ?
if (!$file_exists) {
unset(CApp::$classPaths[$class]);
}
// CSetup* class
if (preg_match('/^CSetup(.+)$/', $class, $matches)) {
$dirs = array("modules/{$matches['1']}/setup.php");
} else {
$class_file = $class;
$suffix = ".class";
// Namespaced class
if (strpos($class_file, "\\") !== false) {
$namespace = explode("\\", $class_file);
// Mediboard class
if ($namespace[0] === "Mediboard") {
array_shift($namespace);
$class_file = implode("/", $namespace);
} else {
$class_file = "vendor/" . implode("/", $namespace);
$suffix = "";
}
}
$class_file .= $suffix;
$dirs = array("classes/{$class_file}.php", "classes/*/{$class_file}.php", "mobile/*/{$class_file}.php", "modules/*/classes/{$class_file}.php", "modules/*/classes/*/{$class_file}.php", "modules/*/classes/*/*/{$class_file}.php", "install/classes/{$class_file}.php");
}
$rootDir = CAppUI::conf("root_dir");
$class_path = false;
foreach ($dirs as $dir) {
$files = glob("{$rootDir}/{$dir}");
foreach ($files as $filename) {
include_once $filename;
// The class was found
if (class_exists($class, false) || interface_exists($class, false)) {
$class_path = $filename;
break 2;
}
}
}
// Class not found, it is not in MB
CApp::$classPaths[$class] = $class_path;
SHM::put("class-paths", CApp::$classPaths);
CApp::$performance["autoload"][$class] = (microtime(true) - $time) * 1000;
return $class_path !== false;
}
开发者ID:fbone,项目名称:mediboard4,代码行数:67,代码来源:autoload.php
示例16: testFunction
function testFunction(&$object, $function_name, $params = array())
{
$str_params = implode(",", $params);
$result = $object->{$function_name}($str_params);
$log = "<div class=\"message\">" . get_class($object) . "::{$function_name}({$str_params}) -> {$result}</div>" . CAppUI::getMsg();
$this->addLog($log);
}
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:7,代码来源:CMbObjectTest.class.php
示例17: loadTikaInfos
/**
* Méthode permettant de tester si le service d'extraction Tika est actif
*
* @return string
*/
function loadTikaInfos()
{
$conf_host = trim(CAppUI::conf("search tika_host"));
$conf_port = trim(CAppUI::conf("search tika_port"));
$client = new CHTTPClient("http://{$conf_host}:{$conf_port}/tika");
return $client->get();
}
开发者ID:fbone,项目名称:mediboard4,代码行数:12,代码来源:CSearchFileWrapper.class.php
示例18: doStore
/**
* Store
*
* @return void
*/
function doStore()
{
// keep track of former values for fieldModified below
$obj = $this->_obj;
$old = $obj->loadOldObject();
if ($msg = $obj->store()) {
CAppUI::setMsg($msg, UI_MSG_ERROR);
if ($this->redirectError) {
CAppUI::redirect($this->redirectError);
}
} else {
// Keep trace for redirections
CValue::setSession($this->objectKey, $obj->_id);
// Insert new group and function permission
if ($obj->fieldModified("function_id") || !$old->_id) {
$obj->insFunctionPermission();
$obj->insGroupPermission();
}
// Message
CAppUI::setMsg($old->_id ? $this->modifyMsg : $this->createMsg, UI_MSG_OK);
// Redirection
if ($this->redirectStore) {
CAppUI::redirect($this->redirectStore);
}
}
}
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:do_mediusers_aed.php
示例19: doRedirect
/**
* @see parent::doRedirect()
*/
function doRedirect()
{
if (CAppUI::conf("dPsalleOp CActeCCAM codage_strict") || !$this->_old->_id || !$this->_obj->_id) {
$this->_ref_object->correctActes();
}
parent::doRedirect();
}
开发者ID:fbone,项目名称:mediboard4,代码行数:10,代码来源:do_acteccam_aed.php
示例20: __construct
/**
* The constructor
*
* @param string $rooturl The URL of the wsdl file
* @param string $type The type of exchange
* @param array $options An array of options
* @param boolean $loggable True if you want to log all the exchanges with the web service
* @param string $local_cert Path of the certifacte
* @param string $passphrase Pass phrase for the certificate
* @param boolean $safe_mode Safe mode
* @param boolean $verify_peer Require verification of SSL certificate used
* @param string $cafile Location of Certificate Authority file on local filesystem
*
* @throws CMbException
*
* @return CNuSOAPClient
*/
function __construct($rooturl, $type = null, $options = array(), $loggable = null, $local_cert = null, $passphrase = null, $safe_mode = false, $verify_peer = false, $cafile = null)
{
$this->wsdl_url = $rooturl;
if ($loggable) {
$this->loggable = $loggable;
}
if ($type) {
$this->type_echange_soap = $type;
}
if (!$safe_mode) {
if (!($html = file_get_contents($this->wsdl_url))) {
$this->soap_client_error = true;
throw new CMbException("CSourceSOAP-unable-to-parse-url", $this->wsdl_url);
}
if (strpos($html, "<?xml") === false) {
$this->soap_client_error = true;
throw new CMbException("CSourceSOAP-wsdl-invalid");
}
}
if (array_key_exists("encoding", $options)) {
$encoding = $options["encoding"];
$this->soap_defencoding = $encoding;
if ($encoding == "UTF-8") {
$this->decode_utf8 = false;
}
}
if ($local_cert) {
$this->certRequest = array("sslcertfile" => $local_cert);
}
if ($passphrase) {
$this->certRequest = array("passphrase" => $passphrase);
}
parent::__construct($rooturl, true, false, false, false, false, CAppUI::conf("webservices connection_timeout"));
$this->wsdl_url = $rooturl;
}
开发者ID:fbone,项目名称:mediboard4,代码行数:52,代码来源:CNuSOAPClient.class.php
注:本文中的CAppUI类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论