本文整理汇总了PHP中Display类的典型用法代码示例。如果您正苦于以下问题:PHP Display类的具体用法?PHP Display怎么用?PHP Display使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Display类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: eventVCardImport
function eventVCardImport(EventControler $evtcl)
{
$msg = "";
$goto = $evtcl->getParam("goto");
$uploaded_file = $_FILES['fields']['name']['contact_vcard'];
if ($uploaded_file) {
$target_path = 'files/' . $uploaded_file;
if (!move_uploaded_file($_FILES['fields']['tmp_name']['contact_vcard'], $target_path)) {
$msg = "There was an error uploading the file, please try again!";
} else {
chmod($target_path, 0755);
$_SESSION['vcard_file'] = $uploaded_file;
$_SESSION['import_tag'] = trim($evtcl->fields['import_tag']);
$retVal = $this->print_vcard_address_book($target_path, 'ofuz vCard Import', '', '', '');
if ($retVal) {
$msg = "Your vCard contacts have been imported successfully.";
} else {
$msg = $this->errMsg;
}
}
} else {
$msg = "Please select a file to be imported.";
}
$disp = new Display($goto);
$disp->addParam("msg", $msg);
if ($evtcl->getParam("fromReg") == 'Yes') {
//if importing while registration
$_SESSION["page_from"] = 'reg';
}
$evtcl->setDisplayNext($disp);
}
示例2: parse
public function parse($data, $file, $filters = array(), $content_var = 'the_content')
{
$display = new Display((array) $filters);
$display->meta = $this->meta;
$display->meta[$content_var] = $data;
return $display->render('layouts/' . $file);
}
示例3: eventShareContactsMultiple
/**
* Event method sharing the contacts with the Co-Workers
* @param object $evtcl
*/
function eventShareContactsMultiple(EventControler $evtcl)
{
$contacts = $evtcl->getParam("idcontacts");
$co_workers = $evtcl->getParam("cwid");
$count = 0;
$no_coworker = 0;
if (is_array($contacts) && is_array($co_workers)) {
$do_tag = new Tag();
foreach ($co_workers as $co) {
foreach ($contacts as $cont) {
if (!$this->checkCoWorkerContactRel($cont, $co)) {
$this->addContactSharings($cont, $co);
$do_tag->addTagOnContactSharing($cont, $co);
$count++;
}
}
}
}
if ($count) {
$msg = 'Sharing Updated succesfully';
} else {
$msg = 'No Data updated,you may be trying to duplicate some contact access';
}
$goto = $evtcl->goto;
$dispError = new Display($goto);
$dispError->addParam("message", $msg);
$evtcl->setDisplayNext($dispError);
}
示例4: eventEditGroup
/**
* Event function to update the group
* Also updates the related member information of the group
* @param object $evctl
* @see modules/Settings/group_edit.php
*/
public function eventEditGroup(EventControler $evctl)
{
$permission = $_SESSION["do_user"]->is_admin == 1 ? true : false;
if (true === $permission) {
if ($evctl->idgroup != '' && $evctl->group_name) {
$qry = "\n\t\t\t\tUPDATE `" . $this->getTable() . "` \n\t\t\t\tset `group_name` = ?,\n\t\t\t\t`description` = ?\n\t\t\t\twhere `idgroup` = ? LIMIT 1";
$this->query($qry, array(CommonUtils::purify_input($evctl->group_name), CommonUtils::purify_input($evctl->description), $evctl->idgroup));
if (is_array($evctl->select_to) && count($evctl->select_to) > 0) {
$do_group_user_rel = new GroupUserRelation();
$do_group_user_rel->update_group_related_to_user($evctl->select_to, $evctl->idgroup);
}
$_SESSION["do_crm_messages"]->set_message('success', _('Group has been updated successfully !'));
$dis = new Display($evctl->next_page);
$dis->addParam("sqrecord", $evctl->idgroup);
$evctl->setDisplayNext($dis);
} else {
$_SESSION["do_crm_messages"]->set_message('error', _('Unable to update the group, either group name or id is missing !'));
$dis = new Display($evctl->error_page);
$evctl->setDisplayNext($dis);
}
} else {
$_SESSION["do_crm_messages"]->set_message('error', _('You do not have permission to edit record !'));
$next_page = NavigationControl::getNavigationLink("Settings", "index");
$dis = new Display($next_page);
$evctl->setDisplayNext($dis);
}
}
示例5: eventChangeGoto
function eventChangeGoto(Eventcontroler $evtcl)
{
$fields = $evtcl->fields;
$dispError = new Display("settings_auto_responder_email.php");
$dispError->addParam("id", $fields["idautoresponder"]);
$evtcl->setDisplayNext($dispError);
}
示例6: get
function get()
{
$profile_uid = intval($_GET['p']);
if (!$profile_uid) {
$profile_uid = -1;
}
$load = argc() > 1 && argv(1) == 'load' ? 1 : 0;
header("Content-type: text/html");
echo "<!DOCTYPE html><html><body>\r\n";
echo $_GET['msie'] == 1 ? '<div>' : '<section>';
$mod = new Display();
$text = $mod->get($profile_uid, $load);
$pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
$replace = "<img\${1} dst=\"\${2}\"";
// $text = preg_replace($pattern, $replace, $text);
/*
if(! $load) {
$replace = '<br />' . t('[Embedded content - reload page to view]') . '<br />';
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
$text = preg_replace($pattern, $replace, $text);
}
*/
echo str_replace("\t", ' ', $text);
echo $_GET['msie'] == 1 ? '</div>' : '</section>';
echo "</body></html>\r\n";
// logger('update_display: ' . $text);
killme();
}
示例7: main
public function main()
{
$db = new Database();
$field1 = 'first_name,second_name,login,reg_password,mail,b_day,telephone';
$user_attr = $db->selectFields($field1, 'login', $_SESSION['login'][0]);
$display = new Display();
$display->view(null, 'registration', $user_attr);
}
示例8: main
public function main()
{
$db = new Database();
// подключаем класс работы с базой
$fetchAll = $db->selectAll('contacts');
$display = new Display();
// подключаем класс отвечающий за структуру вывода на экран
$display->view($fetchAll, 'contacts', null);
}
示例9: main
public function main()
{
$error_id = 'Вы разлогинелись...';
unset($_SESSION['login']);
session_destroy();
$display = new Display();
// подключаем класс отвечающий за структуру вывода на экран
$display->alert($error_id);
$display->view(null, 'enter', null);
}
示例10: eventCheckEmptyFields
function eventCheckEmptyFields(Eventcontroler $evtcl)
{
$field_selected = $evtcl->field_selected;
if (empty($field_selected)) {
$_SESSION['in_page_message'] = _("Please select some labels");
$evtcl->doSave = 'no';
$evtcl->goto = 'settings_wf.php';
$dispError = new Display("settings_wf.php");
$dispError->addParam("e", 'yes');
$evtcl->setDisplayNext($dispError);
}
}
示例11: eventAddRecord
/**
* event function to add a custom view
* @param object $evctl
* @return void
*/
public function eventAddRecord(EventControler $evctl)
{
if (trim($evctl->cvname) == '') {
$_SESSION["do_crm_messages"]->set_message('error', _('Please add a custom view name before saving !'));
$next_page = NavigationControl::getNavigationLink("CustomView", "add");
$dis = new Display($next_page);
$dis->addParam("target_module_id", (int) $evctl->target_module_id);
$evctl->setDisplayNext($dis);
} elseif ((int) $evctl->target_module_id == 0) {
$_SESSION["do_crm_messages"]->set_message('error', _('Missing target module for custom view !'));
$next_page = NavigationControl::getNavigationLink("CustomView", "add");
$dis = new Display($next_page);
$evctl->setDisplayNext($dis);
} elseif (false === $_SESSION["do_crm_action_permission"]->action_permitted('add', 17)) {
$_SESSION["do_crm_messages"]->set_message('error', _('You do not have permission to add record !'));
$next_page = NavigationControl::getNavigationLink($_SESSION["do_module"]->modules_full_details[$evctl->target_module_id]["name"], "list");
$dis = new Display($next_page);
$evctl->setDisplayNext($dis);
} else {
$this->addNew();
$this->name = $evctl->cvname;
$this->iduser = $_SESSION["do_user"]->iduser;
$this->is_default = $evctl->is_default == 'on' ? 1 : 0;
if ($_SESSION["do_user"]->is_admin == 1) {
$this->is_public = $evctl->is_public == 'on' ? 1 : 0;
}
$this->idmodule = (int) $evctl->target_module_id;
$this->is_editable = 1;
$this->add();
$idcustom_view = $this->getInsertId();
//reset default custom view if is_default is set
if ($evctl->is_default == 'on') {
$this->reset_default_custom_view($idcustom_view, $evctl->target_module_id);
}
//add custom view fields
$do_custom_view_fields = new CustomViewFields();
$do_custom_view_fields->add_custom_view_fields($idcustom_view, $evctl->cv_fields);
//add custom view filter
$do_custom_view_filter = new CustomViewFilter();
$do_custom_view_filter->add_custom_view_date_filter($idcustom_view, $evctl->cv_date_field, $evctl->cv_date_field_type, $evctl->cv_date_start, $evctl->cv_date_end);
//add advanced filter
$adv_filter_data = array("cv_adv_fields_1" => $evctl->cv_adv_fields_1, "cv_adv_fields_type_1" => $evctl->cv_adv_fields_type_1, "cv_adv_fields_val_1" => $_POST["cv_adv_fields_val_1"], "cv_adv_fields_2" => $evctl->cv_adv_fields_2, "cv_adv_fields_type_2" => $evctl->cv_adv_fields_type_2, "cv_adv_fields_val_2" => $_POST["cv_adv_fields_val_2"], "cv_adv_fields_3" => $evctl->cv_adv_fields_3, "cv_adv_fields_type_3" => $evctl->cv_adv_fields_type_3, "cv_adv_fields_val_3" => $_POST["cv_adv_fields_val_3"], "cv_adv_fields_4" => $evctl->cv_adv_fields_4, "cv_adv_fields_type_4" => $evctl->cv_adv_fields_type_4, "cv_adv_fields_val_4" => $_POST["cv_adv_fields_val_4"], "cv_adv_fields_5" => $evctl->cv_adv_fields_5, "cv_adv_fields_type_5" => $evctl->cv_adv_fields_type_5, "cv_adv_fields_val_5" => $_POST["cv_adv_fields_val_5"]);
$do_custom_view_filter->add_custom_view_adv_filter($idcustom_view, $adv_filter_data);
//redirect after adding the custom view
$next_page = NavigationControl::getNavigationLink($_SESSION["do_module"]->modules_full_details[$evctl->target_module_id]["name"], "list", '', '&custom_view_id=' . $idcustom_view);
$dis = new Display($next_page);
$evctl->setDisplayNext($dis);
}
}
示例12: display
public function display()
{
$disp = Display::current();
require_once 'packages/magpierss/rss_fetch.inc';
$rss = fetch_rss('http://shortsoup.net.au/?feed=rss2&p=11');
$disp->setValue('comments', $rss->items);
$disp->setValue('add_comment', $rss->channel['link']);
print_r($rss->items);
// Include the javascript for the page
JsRegister::current()->registerScript('home');
// if(Application::current()->user()->authorise('SeeingsystemSetup'))
$disp->setValue('logged_in', true);
// else
// {
// $disp->setValue('login_error',$this->login_error);
// $login_form = Form::load('seeingsystem.views.Login');
// $disp->addForm($login_form);
// }
$disp->setTitle('SeeingSystem - A Flickr Slideshow of Ordinary Beautiful Things');
$disp->addView('page_content', 'seeingsystem.views.Home');
/*
echo "<br />DEBUG: Home::display()<br />\n";
exit;
*/
$disp->displaySiteTemplate();
}
示例13: __construct
function __construct()
{
parent::__construct();
parent::init();
acl_helper::acl_redirect(steamauth_helper::get_role(), 'admin');
Display::instance()->set_template('template-admin');
}
示例14: getElementJS
/**
* Get the necessary javascript for this datepicker
* @return string
*/
private function getElementJS()
{
$js = null;
$id = $this->getAttribute('id');
$js .= "<script>\n \$(function() {\n /*\$('#{$id}').hide().datepicker({\n defaultDate: '" . $this->getValue() . "',\n dateFormat: 'yy-mm-dd',\n altField: '#{$id}_alt',\n altFormat: \"" . get_lang('DateFormatLongNoDayJS') . "\",\n showOn: 'both',\n buttonImage: '" . Display::return_icon('attendance.png', null, [], ICON_SIZE_TINY, true, true) . "',\n buttonImageOnly: true,\n buttonText: '" . get_lang('SelectDate') . "',\n changeMonth: true,\n changeYear: true,\n yearRange: 'c-60y:c+5y'\n });*/\n\n \$('#{$id}').datetimepicker({\n defaultDate: '" . $this->getValue() . "',\n format: 'YYYY-MM-DD'\n });\n\n });\n </script>";
return $js;
}
示例15: instance
static function instance()
{
if (!self::$_display) {
self::$_display = new Display();
}
return self::$_display;
}