本文整理汇总了PHP中Helper类的典型用法代码示例。如果您正苦于以下问题:PHP Helper类的具体用法?PHP Helper怎么用?PHP Helper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Helper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: test
public function test(CqmPatient $patient, $beginDate, $endDate)
{
// See if user has been a tobacco user before or simultaneosly to the encounter within two years (24 months)
$date_array = array();
foreach ($this->getApplicableEncounters() as $encType) {
$dates = Helper::fetchEncounterDates($encType, $patient, $beginDate, $endDate);
$date_array = array_merge($date_array, $dates);
}
// sort array to get the most recent encounter first
$date_array = array_unique($date_array);
rsort($date_array);
// go through each unique date from most recent
foreach ($date_array as $date) {
// encounters time stamp is always 00:00:00, so change it to 23:59:59 or 00:00:00 as applicable
$date = date('Y-m-d 23:59:59', strtotime($date));
$beginMinus24Months = strtotime('-24 month', strtotime($date));
$beginMinus24Months = date('Y-m-d 00:00:00', $beginMinus24Months);
// this is basically a check to see if the patient is an reported as an active smoker on their last encounter
if (Helper::check(ClinicalType::CHARACTERISTIC, Characteristic::TOBACCO_USER, $patient, $beginMinus24Months, $date)) {
return true;
} else {
if (Helper::check(ClinicalType::CHARACTERISTIC, Characteristic::TOBACCO_NON_USER, $patient, $beginMinus24Months, $date)) {
return false;
} else {
// nothing reported during this date period, so move on to next encounter
}
}
}
return false;
}
开发者ID:katopenzz,项目名称:openemr,代码行数:30,代码来源:Denominator.php
示例2: checkFunctionSummery
/**
*Function returns nothing ,checks whether user has added anything in cart or not.
*@param string $email
*@param string $pass
*@var object
*@name $field
*@name $table
*/
public function checkFunctionSummery($email, $pass)
{
$obj = new Helper("ecomm");
if (isset($email) && isset($pass)) {
$field = "user_id";
$table = "user";
$condition = " email_id='{$email}' AND password='{$pass}' ";
$result = $obj->read_record($field, $table, $condition);
if (is_array($result)) {
foreach ($result as $row) {
if ($_SESSION['user'] == $row['user_id']) {
header("Location: OrderSummaryPageIncluded.php");
}
}
} else {
//If the login credentials doesn't match, he will be shown with an error message.
echo "Invalid Login Credentials.";
header("Location: LoginPageIncluded.php");
}
} else {
//If the login credentials doesn't match, he will be shown with an error message.
echo "Invalid Login Credentials.";
header("Location: LoginPageIncluded.php");
}
}
开发者ID:AjinkyaBhosale,项目名称:EcommCIGithub,代码行数:33,代码来源:GenericClass.php
示例3: peoplefindAction
public function peoplefindAction()
{
$people = new Peoplefind();
# die ("....");
$converted = false;
if (!empty($_GET)) {
$_POST = $_GET;
$converted = true;
}
if (!$converted && (!empty($_POST) || !empty($_GET))) {
$params_query = http_build_query($_POST);
header("Location:http://{$_SERVER['HTTP_HOST']}/peoplefind/peoplefind?{$params_query}");
}
$param = $_GET;
if (empty($_GET)) {
$param = $_POST;
}
$search = $people->peoplesearch($param);
$helper = new Helper();
$cohort = $helper->getCohorts();
$cadre = $helper->getCadres();
$institution = $helper->getInstitutions(false);
$facility = $helper->getFacilities();
$this->view->assign('title', $this->view->translation['Application Name']);
$this->view->assign('cohort', $cohort);
$this->view->assign('cadre', $cadre);
$this->view->assign('institution', $institution);
$this->view->assign('facility', $facility);
$this->view->assign('getpeople', $search);
}
开发者ID:falafflepotatoe,项目名称:trainsmart-code,代码行数:30,代码来源:PeoplefindController.php
示例4: peopleaddAction
public function peopleaddAction()
{
//locations
if (count($_POST) > 0) {
if (isset($_POST['addpeople'])) {
$peopleadd = new PeopleAdd();
# TRIGGERS ADDING PERSON
$tutorid = $peopleadd->addTutor($_POST);
switch ($_POST['type']) {
case "tutor":
$this->_redirect(Settings::$COUNTRY_BASE_URL . "/tutoredit/tutoredit/id/" . $tutorid);
break;
}
}
exit;
}
$this->viewAssignEscaped('locations', Location::getAll());
$this->view->assign('action', '../studentedit/studentedit/');
$this->view->assign('title', $this->view->translation['Application Name']);
$persontitle = new Peopleadd();
$result = $persontitle->Peopletitle($fetchtitle);
$this->view->assign('fetchtitle', $result);
// FOr Facility
$faclilityttitle = new Peopleadd();
$result = $faclilityttitle->PeopleFacility($fetchfacility);
$this->view->assign('fetchfacility', $result);
$citylist = new Peopleadd();
$result = $citylist->PeopleCity($citylist);
$this->view->assign('fetchcity', $result);
# CREATING HELPER
$helper = new Helper();
$this->view->assign('institutions', $helper->getInstitutions(false));
}
开发者ID:falafflepotatoe,项目名称:trainsmart-code,代码行数:33,代码来源:PeopleaddController.php
示例5: __construct
public function __construct()
{
$helper = new Helper();
// Why doesn't it resolve the ::class in the Service const BAR?
$thisShouldBeBar = $helper->newInstanceArgs(Service::BAR);
$thisOneWorks = $helper->newInstanceArgs(Bar::class);
}
开发者ID:norrs,项目名称:dynamic_issue,代码行数:7,代码来源:Fail.php
示例6: edit_article_validation
function edit_article_validation()
{
global $edit_article_validation;
$helper_obj = new Helper();
$output = "<script>\$(document).ready(function(){\n \$('#edit_video').validate(\n {\n 'rules': " . json_encode($edit_article_validation) . ",\n 'messages':{\n 'title_updated' :{\n 'required': '" . $helper_obj->t('This field is required') . "' \n },\n 'description_updated' :{\n 'required': '" . $helper_obj->t('This field is required') . "' \n },\n 'edit_category' :{\n 'required': '" . $helper_obj->t('This field is required') . "' \n },\n 'edit_pgrate' :{\n 'required': '" . $helper_obj->t('This field is required') . "' \n },\n }\n }); \n });</script>";
return $output;
}
开发者ID:arh922,项目名称:ain,代码行数:7,代码来源:validation_js.php
示例7: discard
public function discard($index)
{
$card = $this->hand[$index];
$helper = new Helper();
$newHand = $helper->moveCardToLast($this->hand, $index);
$this->hand = $newHand;
return array_pop($this->hand);
}
开发者ID:sourabhpal,项目名称:CardGame,代码行数:8,代码来源:advanced1.php
示例8: __construct
function __construct($id)
{
global $db;
$sql = 'SELECT * FROM account WHERE uid = ?';
$pdo = $db->prepare($sql);
$pdo->bindParam(1, $id, PDO::PARAM_INT);
if (is_numeric($id) && $pdo->execute()) {
if ($pdo->rowCount() > 0) {
$data = $pdo->fetch(PDO::FETCH_ASSOC);
$this->id = $data['uid'];
$this->clan = new Clan($data['clan_id']);
$this->name = $data['name'];
$this->locker = $data['locker'];
$this->score = $data['score'];
$this->kills = $data['kills'];
$this->death = $data['deaths'];
$this->player_since = strtotime($data['first_connect_at']);
$this->last_seen = strtotime($data['last_disconnect_at']);
$this->total_connections = $data['total_connections'];
$sql = 'SELECT * FROM player WHERE account_uid = ?';
$pdo = $db->prepare($sql);
$pdo->bindParam(1, $id, PDO::PARAM_INT);
if ($pdo->execute()) {
foreach ($pdo->fetchAll(PDO::FETCH_ASSOC) as $pl) {
$this->players[] = $pl['id'];
$this->money = $pl['money'];
}
}
$sql = 'SELECT * FROM player_history WHERE account_uid = ?';
$pdo = $db->prepare($sql);
$pdo->bindParam(1, $id, PDO::PARAM_INT);
if ($pdo->execute()) {
$this->players_dead = $pdo->rowCount();
}
$sql = 'SELECT * FROM construction WHERE account_uid = ?';
$pdo = $db->prepare($sql);
$pdo->bindParam(1, $id, PDO::PARAM_INT);
if ($pdo->execute()) {
$this->buildings = $pdo->rowCount();
}
$sql = 'SELECT * FROM vehicle WHERE account_uid = ?';
$pdo = $db->prepare($sql);
$pdo->bindParam(1, $id, PDO::PARAM_INT);
if ($pdo->execute()) {
foreach ($pdo->fetchAll(PDO::FETCH_ASSOC) as $data) {
$this->vehicle[] = $data['id'];
}
}
$helper = new Helper();
$this->territory = $helper->getTerritoryForUser($this->id);
} else {
print_r($pdo->errorInfo());
trigger_error('Wrong ID or ID not Found!', E_USER_ERROR);
}
} else {
trigger_error('Execution failed. DB Error? ' . $id, E_USER_ERROR);
}
}
开发者ID:styler2go,项目名称:ExileModCommunity,代码行数:58,代码来源:account.php
示例9: hookParseTemplate
/**
* Inject the helper for the frontend templates.
*
* @param \Template $template The template being parsed.
*
* @return void
*/
public function hookParseTemplate(\Template $template)
{
if (substr($template->getName(), 0, 3) === 'fe_') {
$helper = new Helper($template);
$template->flexibleSections = function ($position, $template = 'block_sections') use($helper) {
echo $helper->getCustomSections($position, $template);
};
$template->getFlexibleSectionsHelper = function () use($helper) {
return $helper;
};
}
}
开发者ID:netzmacht,项目名称:contao-flexible-sections,代码行数:19,代码来源:HelperInjector.php
示例10: peopleAction
public function peopleAction()
{
$helper = new Helper();
$cohort = $helper->getCohorts();
$cadre = $helper->getCadres();
$institution = $helper->getInstitutions(false);
$facility = $helper->getFacilities();
$this->view->assign('title', $this->view->translation['Application Name']);
$this->view->assign('cohort', $cohort);
$this->view->assign('cadre', $cadre);
$this->view->assign('institution', $institution);
$this->view->assign('facility', $facility);
}
开发者ID:falafflepotatoe,项目名称:trainsmart-code,代码行数:13,代码来源:PeopleController.php
示例11: bar_task
public function bar_task($id)
{
$help = new Helper();
$issues = $help->searchIssues($id);
//foreach ($issues as $issue) {
# code...
// $issue->id
//}
//$iteration = Iterations::findOrFail($id);
//$idTmp = $iteration->id;
// $issues = Issue::where('iterationid','=', $idTmp)->get();
//$issues = $iteration->issues;
//$countIssues = sizeof($issues);
$countIssues = 0;
$dataEstimatedTime = array();
$dataRealTime = array();
$dataIterationName = array();
$countTODO = 0;
$countDOING = 0;
$countDONE = 0;
//$string_iterations = implode(";", $iterations);
JpGraph\JpGraph::load();
JpGraph\JpGraph::module('bar');
JpGraph\JpGraph::module('line');
$datay = array(12, 8, 19, 3, 10, 5);
// Create the graph. These two calls are always required
$graph = new Graph(300, 200);
$graph->SetScale('textlin');
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->SetMargin(40, 30, 20, 40);
// Create a bar pot
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor('orange');
$graph->Add($bplot);
// Setup the titles
$graph->title->Set('A basic bar graph ');
$graph->xaxis->title->Set('X-title');
$graph->yaxis->title->Set('Y-title');
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
//$graph->Stroke();
//$response = Response::make(
// $graph->Stroke()
//);
// $response->header('content-type', 'image/png');
// return $response;
}
开发者ID:josimarjimenez,项目名称:architects,代码行数:51,代码来源:GraphicsTaskController.php
示例12: displayAjaxCategoriesList
/**
* Listing ajax des catégories
*/
public function displayAjaxCategoriesList()
{
//Insertion des styles admin nécessaire à l'affichage des actions ajax
foreach ($this->css_files as $css_key => $css_type) {
echo '<link rel="stylesheet" type="text/css" href="' . $css_key . '" type="' . $css_type . '"/>';
}
//Géneration du tree des catégories
if (_PS_VERSION_ < '1.6') {
$categoryTree = new Helper();
echo $categoryTree->renderCategoryTree(2, array(), 'id-category-for-insert');
} else {
$categoryTree = new HelperTreeCategories('categories-tree', $this->l('Check the category to display the link'));
echo $categoryTree->setAttribute()->setInputName('id-category-for-insert')->render();
}
}
开发者ID:nenes25,项目名称:prestashop_eicmslinks,代码行数:18,代码来源:wysiwyg.php
示例13: ObjectName
public function ObjectName($option = null)
{
if ($option != null && is_array($option)) {
$objectType = $option['IntObjectType'];
if (array_key_exists('Facility', $option)) {
$facility = $option['Facility'];
$facility_id = $facility['id'];
} else {
$facility_id = $this->ID;
}
if (array_key_exists('ExtensionPhaseType', $option)) {
$phaseType = $option['ExtensionPhaseType'];
$phaseTypeId = $phaseType['id'];
} else {
if (array_key_exists('CodeProductType', $option)) {
$phaseType = $option['CodeProductType'];
$phaseTypeId = $phaseType['id'];
} else {
$phaseTypeId = 0;
}
}
$mdlName = $objectType['name'];
$mdl = \Helper::getModelName($mdlName);
return $mdl::getEntries($facility_id, $phaseTypeId);
}
return null;
}
开发者ID:hunglmtb,项目名称:eb,代码行数:27,代码来源:ObjectNameLoad.php
示例14: test
public function test(CqmPatient $patient, $beginDate, $endDate)
{
// Flow of control loop
$return = false;
do {
// See if BMI has been recorded between >=22kg/m2 and <30kg/m2 6 months before, or simultanious to the encounter
$query = "SELECT form_vitals.BMI " . "FROM `form_vitals` " . "LEFT JOIN `form_encounter` " . "ON ( form_vitals.pid = form_encounter.pid ) " . "LEFT JOIN `enc_category_map` " . "ON (enc_category_map.main_cat_id = form_encounter.pc_catid) " . "WHERE form_vitals.BMI IS NOT NULL " . "AND form_vitals.BMI IS NOT NULL " . "AND form_vitals.pid = ? AND form_vitals.BMI >= 22 AND form_vitals.BMI < 30 " . "AND DATE( form_vitals.date ) >= DATE_ADD( form_encounter.date, INTERVAL -6 MONTH ) " . "AND DATE( form_vitals.date ) <= DATE( form_encounter.date ) " . "AND ( enc_category_map.rule_enc_id = 'enc_outpatient' )";
$res = sqlStatement($query, array($patient->id));
$number = sqlNumRows($res);
if ($number >= 1) {
$return = true;
break;
}
// See if BMI has been recorded >=30kg/m2 6 months before, or simultanious to the encounter
// AND ÒCare goal: follow-up plan BMI managementÓ OR ÒCommunication provider to provider: dietary consultation orderÓ
$query = "SELECT form_vitals.BMI " . "FROM `form_vitals` " . "LEFT JOIN `form_encounter` " . "ON ( form_vitals.pid = form_encounter.pid ) " . "LEFT JOIN `enc_category_map` " . "ON (enc_category_map.main_cat_id = form_encounter.pc_catid) " . "WHERE form_vitals.BMI IS NOT NULL " . "AND form_vitals.BMI IS NOT NULL " . "AND form_vitals.pid = ? AND form_vitals.BMI >= 30 " . "AND ( DATE( form_vitals.date ) >= DATE_ADD( form_encounter.date, INTERVAL -6 MONTH ) ) " . "AND ( DATE( form_vitals.date ) <= DATE( form_encounter.date ) ) " . "AND ( enc_category_map.rule_enc_id = 'enc_outpatient' )";
$res = sqlStatement($query, array($patient->id));
$number = sqlNumRows($res);
if ($number >= 1 && (Helper::check(ClinicalType::CARE_GOAL, CareGoal::FOLLOW_UP_PLAN_BMI_MGMT, $patient) || Helper::check(ClinicalType::COMMUNICATION, Communication::DIET_CNSLT, $patient))) {
$return = true;
break;
}
// See if BMI has been recorded <22kg/m2 6 months before, or simultanious to the encounter
// AND ÒCare goal: follow-up plan BMI managementÓ OR ÒCommunication provider to provider: dietary consultation orderÓ
$query = "SELECT form_vitals.BMI " . "FROM `form_vitals` " . "LEFT JOIN `form_encounter` " . "ON ( form_vitals.pid = form_encounter.pid ) " . "LEFT JOIN `enc_category_map` " . "ON (enc_category_map.main_cat_id = form_encounter.pc_catid) " . "WHERE form_vitals.BMI IS NOT NULL " . "AND form_vitals.BMI IS NOT NULL " . "AND form_vitals.pid = ? AND form_vitals.BMI < 22 " . "AND ( DATE( form_vitals.date ) >= DATE_ADD( form_encounter.date, INTERVAL -6 MONTH ) ) " . "AND ( DATE( form_vitals.date ) <= DATE( form_encounter.date ) ) " . "AND ( enc_category_map.rule_enc_id = 'enc_outpatient' )";
$res = sqlStatement($query, array($patient->id));
$number = sqlNumRows($res);
if ($number >= 1 && (Helper::check(ClinicalType::CARE_GOAL, CareGoal::FOLLOW_UP_PLAN_BMI_MGMT, $patient) || Helper::check(ClinicalType::COMMUNICATION, Communication::DIET_CNSLT, $patient))) {
$return = true;
break;
}
} while (false);
return $return;
}
开发者ID:katopenzz,项目名称:openemr,代码行数:34,代码来源:Numerator1.php
示例15: actionIndex
/**
* 程序文件列表
*/
public function actionIndex()
{
if (isset($_POST['id'])) {
$files = $_POST['id'];
if ($files) {
//提交打包
$zip = new ZipArchive();
$name = 'yiifcmsBAK_' . date('YmdHis', time()) . '.zip';
$zipname = WWWPATH . '/' . $name;
//创建一个空的zip文件
if ($zip->open($zipname, ZipArchive::OVERWRITE)) {
foreach ((array) $files as $file) {
if (is_dir($file)) {
//递归检索文件
$allfiles = Helper::scanfDir($file, true);
foreach ((array) $allfiles['files'] as $v) {
$zip->addFile(WWWPATH . '/' . $v, $v);
}
} else {
$zip->addFile(WWWPATH . '/' . $file, $file);
}
}
$zip->close();
//开始下载
Yii::app()->request->sendFile($name, file_get_contents($zipname), '', false);
//下载完成后要进行删除
@unlink($zipname);
} else {
throw new CHttpException('404', 'Failed');
}
}
} else {
$files = Helper::scanfDir(WWWPATH);
asort($files['dirs']);
asort($files['files']);
$files = array_merge($files['dirs'], $files['files']);
$listfiles = array();
foreach ($files as $file) {
$tmpfilename = explode('/', $file);
$filename = end($tmpfilename);
if (is_dir($file)) {
$allfiles = Helper::scanfDir($file, true);
if ($allfiles['files']) {
$filesize = 0;
foreach ((array) $allfiles['files'] as $val) {
$filesize += filesize($val);
}
}
$listfiles[$filename]['type'] = 'dir';
} else {
$filesize = filesize($file);
$listfiles[$filename]['type'] = 'file';
}
$listfiles[$filename]['id'] = $filename;
$listfiles[$filename]['size'] = Helper::byteFormat($filesize);
$listfiles[$filename]['update_time'] = filemtime($filename);
}
}
$this->render('index', array('listfiles' => $listfiles));
}
开发者ID:github-zjh,项目名称:task,代码行数:63,代码来源:ZipController.php
示例16: actionHeadermobile
public function actionHeadermobile()
{
$model = new Form_Headers_Mobile();
$setting = array();
foreach (get_object_vars($model) as $key => $null) {
$setting[$key] = $this->loadSetting($key);
$model->{$key} = $setting[$key]->option_value;
}
if (isset($_POST['Form_Headers_Mobile'])) {
$transaction = Yii::app()->db->beginTransaction();
try {
$model->attributes = $_POST['Form_Headers_Mobile'];
if ($model->validate()) {
foreach (get_object_vars($model) as $key => $null) {
$setting[$key]->option_value = str_replace(Helper::rootImg('content'), '', $_POST['Form_Headers_Mobile'][$key]);
if (!$setting[$key]->save()) {
throw new Exception($setting[$key]->getError('value'));
}
}
$transaction->commit();
$message = "<strong>Well done!</strong> You successfully Update Settings";
Yii::app()->user->setFlash('info', $message);
$this->refresh();
}
} catch (Exception $e) {
$transaction->rollBack();
Yii::app()->user->setFlash('error', "{$e->getMessage()}");
$this->refresh();
}
}
$this->render('mobile', compact('model', 'data'));
}
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:32,代码来源:HeaderController.php
示例17: query
public function query($postdata)
{
if ($this->user->getClass() < User::CLASS_ADMIN) {
throw new Exception(L::get("PERMISSION_DENIED"), 401);
}
$limit = (int) $postdata["limit"] ?: 25;
$index = (int) $postdata["index"] ?: 0;
$search = $postdata["search"] ?: "";
$where = "";
if (strlen($search) > 0) {
$searchWords = Helper::searchTextToWordParams($search);
$where = "WHERE MATCH (adminlog.search_text) AGAINST (" . $this->db->quote($searchWords) . " IN BOOLEAN MODE)";
}
$sth = $this->db->query("SELECT COUNT(*) FROM adminlog " . $where);
$res = $sth->fetch();
$totalCount = $res[0];
$sth = $this->db->prepare("SELECT adminlog.added, adminlog.id AS aid, adminlog.txt, users.id, users.username FROM adminlog LEFT JOIN users ON adminlog.userid = users.id " . $where . " ORDER BY adminlog.id DESC LIMIT ?, ?");
$sth->bindParam(1, $index, PDO::PARAM_INT);
$sth->bindParam(2, $limit, PDO::PARAM_INT);
$sth->execute();
$result = array();
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
$r = array();
$r["id"] = $row["aid"];
$r["added"] = $row["added"];
$r["txt"] = str_replace("{{username}}", "[url=/user/" . $row["id"] . "/" . $row["username"] . "][b]" . $row["username"] . "[/b][/url]", $row["txt"]);
array_push($result, $r);
}
return array($result, $totalCount);
}
开发者ID:swetorrentking,项目名称:rartracker,代码行数:30,代码来源:AdminLogs.php
示例18: start
/**
* Start a editing session or return an existing one
* @param string $uid of the user starting a session
* @param \OCA\Documents\File $file - file object
* @return array
* @throws \Exception
*/
public static function start($uid, $file)
{
// Create a directory to store genesis
$genesis = new Genesis($file);
list($ownerView, $path) = $file->getOwnerViewAndPath();
$oldSession = new Db_Session();
$oldSession->loadBy('file_id', $file->getFileId());
//If there is no existing session we need to start a new one
if (!$oldSession->hasData()) {
$newSession = new Db_Session(array($genesis->getPath(), $genesis->getHash(), $file->getOwner(), $file->getFileId()));
if (!$newSession->insert()) {
throw new \Exception('Failed to add session into database');
}
}
$sessionData = $oldSession->loadBy('file_id', $file->getFileId())->getData();
$memberColor = Helper::getMemberColor($uid);
$member = new Db_Member(array($sessionData['es_id'], $uid, $memberColor, time(), intval($file->isPublicShare()), $file->getToken()));
if ($member->insert()) {
// Do we have OC_Avatar in out disposal?
if (!class_exists('\\OC_Avatar') || \OC_Config::getValue('enable_avatars', true) !== true) {
$imageUrl = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAAAAACH5BAAAAAAALAAAAAABAAEAAAICTAEAOw==';
} else {
$imageUrl = $uid;
}
$displayName = $file->isPublicShare() ? $uid . ' ' . Db_Member::getGuestPostfix() : \OCP\User::getDisplayName($uid);
$sessionData['member_id'] = (string) $member->getLastInsertId();
$op = new Db_Op();
$op->addMember($sessionData['es_id'], $sessionData['member_id'], $displayName, $memberColor, $imageUrl);
} else {
throw new \Exception('Failed to add member into database');
}
$sessionData['title'] = basename($path);
$sessionData['permissions'] = $ownerView->getFilePermissions($path);
return $sessionData;
}
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:42,代码来源:session.php
示例19: popup_elements
function popup_elements()
{
$animation_speed = Helper::get_animation_speed_data();
$animation_direction = Helper::get_animation_direction_data();
$animation_type = Helper::get_animation_type_data();
$this->config['subElements'] = array(array("name" => __('Alert Type', 'fusion-core'), "desc" => __('Select the type of alert message. Choose custom for advanced color options below.', 'fusion-core'), "id" => "fusion_type", "type" => ElementTypeEnum::SELECT, "value" => "general", "allowedValues" => array('general' => __('General', 'fusion-core'), 'error' => __('Error', 'fusion-core'), 'success' => __('Success', 'fusion-core'), 'notice' => __('Notice', 'fusion-core'), 'custom' => __('Custom', 'fusion-core'))), array("name" => __('Accent Color', 'fusion-core'), "desc" => __('Custom setting only. Set the border, text and icon color for custom alert boxes.', 'fusion-core'), "id" => "fusion_accentcolor", "type" => ElementTypeEnum::COLOR, "value" => ""), array("name" => __('Background Color', 'fusion-core'), "desc" => __('Custom setting only. Set the background color for custom alert boxes.', 'fusion-core'), "id" => "fusion_backgroundcolor", "type" => ElementTypeEnum::COLOR, "value" => ""), array("name" => __('Border Width', 'fusion-core'), "desc" => __('Custom setting. For custom alert boxes. In pixels (px), ex: 1px.', 'fusion-core'), "id" => "fusion_bordersize", "type" => ElementTypeEnum::INPUT, "value" => "1px"), array("name" => __('Select Custom Icon', 'fusion-core'), "desc" => __('Custom setting only. Click an icon to select, click again to deselect', 'fusion-core'), "id" => "icon", "type" => ElementTypeEnum::ICON_BOX, "value" => "", "list" => Helper::GET_ICONS_LIST()), array("name" => __('Box Shadow', 'fusion-core'), "desc" => __('Display a box shadow below the alert box.', 'fusion-core'), "id" => "fusion_boxshadow", "type" => ElementTypeEnum::SELECT, "value" => "yes", "allowedValues" => array('yes' => __('Yes', 'fusion-core'), 'no' => __('No', 'fusion-core'))), array("name" => __('Alert Content', 'fusion-core'), "desc" => __('Insert the alert\'s content', 'fusion-core'), "id" => "fusion_content_wp", "type" => ElementTypeEnum::HTML_EDITOR, "value" => __('Your Content Goes Here', 'fusion-core')), array("name" => __('Animation Type', 'fusion-core'), "desc" => __('Select the type on animation to use on the shortcode', 'fusion-core'), "id" => "fusion_animation_type", "type" => ElementTypeEnum::SELECT, "value" => "", "allowedValues" => $animation_type), array("name" => __('Direction of Animation', 'fusion-core'), "desc" => __('Select the incoming direction for the animation', 'fusion-core'), "id" => "fusion_animation_direction", "type" => ElementTypeEnum::SELECT, "value" => "left", "allowedValues" => $animation_direction), array("name" => __('Speed of Animation', 'fusion-core'), "desc" => __('Type in speed of animation in seconds (0.1 - 1)', 'fusion-core'), "id" => "fusion_animation_speed", "type" => ElementTypeEnum::SELECT, "value" => "", "allowedValues" => $animation_speed), array("name" => __('CSS Class', 'fusion-core'), "desc" => __('Add a class to the wrapping HTML element.', 'fusion-core'), "id" => "fusion_class", "type" => ElementTypeEnum::INPUT, "value" => ""), array("name" => __('CSS ID', 'fusion-core'), "desc" => __('Add an ID to the wrapping HTML element.', 'fusion-core'), "id" => "fusion_id", "type" => ElementTypeEnum::INPUT, "value" => ""));
}
开发者ID:ftopolovec,项目名称:proart,代码行数:7,代码来源:class-alert-box.php
示例20: makeFileName
public static function makeFileName(\Freetrix\Iblock\InheritedProperty\BaseTemplate $ipropTemplates, $templateName, $arFields, $arFile)
{
if (preg_match("/^(.+)(\\.[a-zA-Z0-9]+)\$/", $arFile["name"], $fileName)) {
if (!isset($arFields["IPROPERTY_TEMPLATES"]) || $arFields["IPROPERTY_TEMPLATES"][$templateName] == "") {
$templates = $ipropTemplates->findTemplates();
$TEMPLATE = $templates[$templateName]["TEMPLATE"];
} else {
$TEMPLATE = $arFields["IPROPERTY_TEMPLATES"][$templateName];
}
if ($TEMPLATE != "") {
list($template, $modifiers) = Helper::splitTemplate($TEMPLATE);
if ($template != "") {
$values = $ipropTemplates->getValuesEntity();
$entity = $values->createTemplateEntity();
$entity->setFields($arFields);
return \Freetrix\Iblock\Template\Engine::process($entity, $TEMPLATE) . $fileName[2];
} elseif ($modifiers != "") {
$simpleTemplate = new NodeRoot();
$simpleTemplate->addChild(new NodeText($fileName[1]));
$simpleTemplate->setModifiers($modifiers);
$baseEntity = new Entity\Base(0);
return $simpleTemplate->process($baseEntity) . $fileName[2];
}
}
}
return $arFile["name"];
}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:27,代码来源:helper.php
注:本文中的Helper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论