当前位置: 首页>>代码示例>>PHP>>正文


PHP array_remove函数代码示例

本文整理汇总了PHP中array_remove函数的典型用法代码示例。如果您正苦于以下问题:PHP array_remove函数的具体用法?PHP array_remove怎么用?PHP array_remove使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了array_remove函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: test_array_remove

 /**
  * @dataProvider array_remove_provider
  */
 public function test_array_remove($path)
 {
     $array = [];
     array_set($array, $path, 'foo');
     $this->assertTrue(array_has($array, $path));
     array_remove($array, $path);
     $this->assertFalse(array_has($array, $path));
 }
开发者ID:weew,项目名称:helpers-array,代码行数:11,代码来源:ArrayTest.php

示例2: check_wait

function check_wait($pid)
{
    global $pids, $procs;
    array_push($pids, $pid);
    if (count($pids) > $procs) {
        $pid = pcntl_wait($status);
        array_remove($pid, $pids);
    }
}
开发者ID:GallardoAlba,项目名称:Meneame,代码行数:9,代码来源:thumbs_delete_old_unpublished.php

示例3: getShellList

 static function getShellList()
 {
     global $gbl, $sgbl, $login, $ghtml;
     $shell_file = "__path_real_etc_root/shells";
     $newcont = lfile_trim($shell_file);
     $newcont = array_remove($newcont, $sgbl->__var_noaccess_shell);
     $shells = add_disabled($newcont);
     return $shells;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:9,代码来源:uuser__linuxlib.php

示例4: getServiceList

 static function getServiceList()
 {
     global $gbl, $sgbl, $login, $ghtml;
     $val = lscandir_without_dot("__path_real_etc_root/init.d");
     $val = array_remove($val, $sgbl->__var_programname_web);
     $val = array_remove($val, $sgbl->__var_programname_dns);
     $val = array_remove($val, $sgbl->__var_programname_imap);
     $val = array_remove($val, $sgbl->__var_programname_mmail);
     $nval = self::getMainServiceList();
     $nval = lx_array_merge(array($nval, $val));
     return $nval;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:12,代码来源:service__linuxlib.php

示例5: set

 /**
  * Sets config value
  *
  * @param string $path
  * @param mixed  $value
  * @param string $canonical_path
  */
 public function set($path, $value, $canonical_path = null)
 {
     if ($canonical_path === null) {
         $canonical_path = $this->getCanonicalPath($path);
     }
     // remove if the path isn't protected and it's empty or has a default value
     $default_value = $this->getDefault($canonical_path);
     if (!isset($this->persistKeys[$canonical_path]) && ($value == $default_value || empty($value) && empty($default_value))) {
         array_remove($path, $_SESSION['ConfigFile']);
     } else {
         array_write($path, $_SESSION['ConfigFile'], $value);
     }
 }
开发者ID:shishenkov,项目名称:zpanel,代码行数:20,代码来源:ConfigFile.class.php

示例6: generatePage

 public static function generatePage(&$tpl, &$session, &$account, &$perso)
 {
     $dbMgr = DbManager::getInstance();
     //Instancier le gestionnaire
     $db = $dbMgr->getConn('game');
     //Demander la connexion existante
     $errorUrl = '?popup=1&m=Action_Perso_Parler';
     //Valider si: Aucun message tappé et on essaie pas de montrer un Badge
     if ((!isset($_POST['msg']) || empty($_POST['msg'])) && (!isset($_POST['badge']) || $_POST['badge'] == '0')) {
         return fctErrorMSG('Aucun message à envoyer.', $errorUrl);
     }
     $msg_type = 'parler';
     //Charger les informations sur le badge et cr.er l'entête du message si nécéssaire.
     if (isset($_POST['badge']) && $_POST['badge'] != '0') {
         $badge_txt = '';
         $msg_type = 'parlerbadge';
         if ($_POST['badge'] == 'VISAVERT' && $perso->getVisaPerm() == '1') {
             $badge_txt = 'Une personne vous présente son Visa Vert: ' . $perso->getNom() . '[hr]';
         } else {
             //Trouver le badge sélectionné
             $i = 0;
             $trouve = false;
             while ($item = $perso->getInventaire($i++)) {
                 if ($item->getInvId() == $_POST['badge']) {
                     $trouve = true;
                     break;
                 }
             }
             if ($trouve) {
                 $badge_txt = 'Une personne vous présente son ' . $item->getNom() . ': ' . $item->getTitre() . ' (' . $item->getContenu() . ') [hr]';
             } else {
                 return fctErrorMSG('Le badge que vous avez sélectionné n\'existe pas.', $errorUrl);
             }
         }
         $_POST['msg'] = $badge_txt . $_POST['msg'];
     }
     if (!isset($_POST['to'])) {
         $_POST['to'] = 'Note perso.';
     } else {
         //Si des destinataires sont recu, les valider et leur faire parvenir le message
         for ($i = 0; $i < count($_POST['to']); $i++) {
             if (!$perso->getLieu()->confirmPerso($perso, $_POST['to'][$i])) {
                 array_remove($_POST['to'], $i);
             }
         }
     }
     //Copier le message dans les HE
     Member_He::add($perso->getId(), $_POST['to'], $msg_type, $_POST['msg']);
     //Rafraichir le HE
     return $tpl->fetch($account->getSkinRemotePhysicalPath() . 'html/Member/herefresh.htm', __FILE__, __LINE__);
 }
开发者ID:FMaz008,项目名称:ccv4,代码行数:51,代码来源:Parler2.php

示例7: __construct

 function __construct()
 {
     // 检测语言
     if (isset($_COOKIE['tt2_lang'])) {
         $GLOBALS['i18n'] = z(t(basename($_COOKIE['tt2_lang'])));
     } else {
         $GLOBALS['i18n'] = c('default_language');
     }
     __('TEST');
     // force to load langua array before plugin
     // 安装时不启用插件
     if (g('c') != 'install') {
         // 载入插件
         $plugins = c('plugins');
         if (my_sql("SHOW COLUMNS FROM `plugin`")) {
             if ($pinfos = get_data("SELECT * FROM `plugin`")) {
                 foreach ($pinfos as $pinfo) {
                     if (intval($pinfo['on']) == 0) {
                         $plugins = array_remove($pinfo['folder_name'], $plugins);
                     } elseif (!in_array($pinfo['folder_name'], $plugins)) {
                         $plugins[] = $pinfo['folder_name'];
                     }
                 }
             }
         }
         if (is_array($plugins)) {
             $plugins = array_unique($plugins);
         }
         if (isset($plugins) && is_array($plugins)) {
             foreach ($plugins as $plugin) {
                 $plugin_file = c('plugin_path') . DS . basename($plugin) . DS . 'app.php';
                 if (file_exists($plugin_file)) {
                     require_once $plugin_file;
                 }
             }
         }
         $GLOBALS['config']['plugins'] = $plugins;
     }
     // update config for this time
     // 载入默认的
     parent::__construct();
     do_action('CTRL_ALL');
     apply_filter('CTRL_' . g('c') . '_' . g('a') . '_INPUT_FILTER');
     if (g('c') != 'api') {
         // set session time
         session_set_cookie_params(c('session_time'));
         @session_start();
     }
     do_action('CTRL_SESSION_STARTED');
 }
开发者ID:wangkf,项目名称:TeamToy,代码行数:50,代码来源:app.class.php

示例8: removeByName

 /**
  * @param $key
  */
 public function removeByName($key)
 {
     /** @var ICookie $cookie */
     $cookie = array_get($this->cookies, $key);
     array_remove($this->cookies, $key);
     if ($cookie !== null) {
         $cookie = $cookie->toString();
         $headers = $this->holder->getHeaders()->get('set-cookie');
         foreach ($headers as $index => $header) {
             if ($header == $cookie) {
                 $this->holder->getHeaders()->remove(s('%s.%s', 'set-cookie', $index));
             }
         }
     }
 }
开发者ID:weew,项目名称:http,代码行数:18,代码来源:Cookies.php

示例9: getEntityConfig

 protected static function getEntityConfig($relation_type, $collection_name, $field, $config)
 {
     // collection names are always plural
     $collection = array_remove($config, 'collection') ?: $field;
     $config['collection'] = str_plural($collection);
     $foreign_key = array_remove($config, 'foreign_key');
     if (!$foreign_key) {
         $foreign_key = $relation_type == 'has_many' ? str_singular($collection_name) . '_id' : str_singular($field) . '_id';
     }
     $config['foreign_key'] = $foreign_key;
     $config['primary_key'] = array_remove($config, 'primary_key') ?: '_id';
     if ($relation_type == 'belongs_to') {
         // belongs_to relation types have the following additional config keys:
         $config['required'] = array_remove($config, 'required') ?: false;
         $config['on_delete'] = array_remove($config, 'on_delete') ?: 'none';
         $config['on_update'] = array_remove($config, 'on_update') ?: 'none';
     }
     return $config;
 }
开发者ID:CFLOVEYR,项目名称:hook,代码行数:19,代码来源:Relation.php

示例10: select

 public static function select($args, $attributes)
 {
     $options = array_remove($attributes, 'options');
     $selected_option = array_remove($attributes, 'selected');
     if (!isset($attributes['name']) && isset($args[0])) {
         // TODO: analyse context recursively
         if (Slim\Views\Lightncandy::$context->count() > 0) {
             $attributes['name'] = Slim\Views\Lightncandy::$context->top() . '[' . $args[0] . ']';
         } else {
             $attributes['name'] = $args[0];
         }
     }
     $html_options = '';
     foreach ($options as $key => $value) {
         $key = isset($value['_id']) ? $value['_id'] : $key;
         $value = isset($value['name']) ? $value['name'] : $value;
         $is_selected = $selected_option == $key ? ' selected="selected"' : '';
         $html_options .= '<option value="' . $key . '"' . $is_selected . '>' . $value . '</option>';
     }
     return array('<select' . static::html_attributes($attributes) . '>' . $html_options . '</select>', 'raw');
 }
开发者ID:endel,项目名称:slim-lightncandy-view,代码行数:21,代码来源:Helper.php

示例11: orderBy

 static function orderBy($field, $label)
 {
     $Dispatcher = Dispatcher::getInstance();
     $params = $Dispatcher->getParams();
     $orderby = $field;
     $dir = 'asc';
     $reverse = 'desc';
     $class = '';
     $filter = Config::get('pagination.filter');
     $path = UrlComponent::whitelist(array_remove($filter, array('orderby', 'dir')));
     if (isset($params['orderby']) && $params['orderby'] == $field) {
         $orderby = $params['orderby'];
         if (isset($params['dir']) && $params['dir'] == 'asc') {
             $class = 'class="order-asc"';
             $reverse = 'desc';
         } else {
             $class = 'class="order-desc"';
             $reverse = 'asc';
         }
     }
     return '<a href="' . $path . '/orderby/' . $orderby . '/dir/' . $reverse . '" ' . $class . '>' . $label . '</a>';
 }
开发者ID:nicolasmartin,项目名称:framework,代码行数:22,代码来源:Url.php

示例12: updateform

 function updateform($subaction, $param)
 {
     global $gbl, $sgbl, $login, $ghtml;
     switch ($subaction) {
         case "installatron":
             $vlist['__v_button'] = array();
             return $vlist;
         case "ostemplatelist":
             getResourceOstemplate($vlist, 'all');
             $vlist['__v_updateall_button'] = array();
             return $vlist;
         case "createinvoice_m":
             $vlist['month'] = null;
             return $vlist;
         case "createinvoice_s":
             $vlist['month'] = array('s', $this->getInvoiceMonthList());
             return $vlist;
         case "search_engine":
             $vlist['se_url'] = array('M', "http://");
             $vlist['se_email'] = null;
             return $vlist;
         case "cron_mailto":
             $vlist['cron_mailto'] = null;
             return $vlist;
         case "default_domain":
             $vlist['default_domain'] = array('s', add_disabled(get_namelist_from_objectlist($this->getList('domain'))));
             return $vlist;
         case "shell_access":
             $res[] = "/bin/bash";
             $res[] = "/usr/bin/lxjailshell";
             $res = add_disabled($res);
             $vlist['nname'] = array('M', null);
             $vlist['disable_system_flag'] = null;
             $vlist['shell'] = array('s', $res);
             $vlist['__v_updateall_button'] = array();
             return $vlist;
         case "generate_csr":
             include "lib/countrycode.inc";
             foreach ($gl_country_code as $key => $name) {
                 $temp[$key] = $name;
             }
             $s = new sslcert(null, null, null);
             $this->ssl_data_b = new ssl_data_b(null, null, null);
             $vlist['contactemail'] = array('M', null);
             $vlist["ssl_data_b_s_commonName_r"] = null;
             $vlist["ssl_data_b_s_emailAddress_r"] = null;
             $vlist["ssl_data_b_s_countryName_r"] = array('A', $temp);
             $vlist["ssl_data_b_s_stateOrProvinceName_r"] = null;
             $vlist["ssl_data_b_s_localityName_r"] = null;
             $vlist["ssl_data_b_s_organizationName_r"] = null;
             $vlist["ssl_data_b_s_organizationalUnitName_r"] = null;
             return $vlist;
         case "domainpserver":
             if ($this->isAdmin()) {
                 $parent = $this;
             } else {
                 $parent = $this->getParentO();
             }
             self::getDomainServerVlist($parent, $this, $vlist);
             return $vlist;
         case "forcedeletepserver":
             if_not_admin_complain_and_exit();
             $list = get_namelist_from_objectlist($this->getList('pserver'));
             $vlist['pserver_delete_f'] = array('s', array_remove($list, "localhost"));
             return $vlist;
         case "deleteorphanedvps":
             $sq = new Sqlite(null, 'vps');
             $slist = get_namelist_from_objectlist($this->getList('pserver'));
             $res = $sq->getTable(array('nname', 'syncserver', 'parent_clname'));
             $list = null;
             foreach ($res as $r) {
                 if (!array_search_bool($r['syncserver'], $slist)) {
                     $list[$r['nname']] = "{$r['nname']} ({$r['syncserver']}) (orphaned)";
                 }
             }
             if ($list) {
                 $vlist['vps_delete_f'] = array('A', $list);
             } else {
                 $vlist['vps_delete_f'] = array('M', 'No Orphaned vm');
             }
             return $vlist;
         case "multivpscreate":
             $vlist['vps_basename_f'] = null;
             $vlist['vps_admin_password_f'] = null;
             $vlist['vps_count_f'] = null;
             $vlist['vps_template_name_f'] = array('s', get_namelist_from_objectlist($this->getList('vpstemplate')));
             return $vlist;
         case "disable_url":
             $vlist['disable_url'] = array('m', array('pretext' => 'http://'));
             return $vlist;
         case "message":
             $vlist['wall_from_f'] = array('M', $login->nname);
             $vlist['send_to_f'] = array('M', $this->nname);
             $vlist['wall_subject_f'] = null;
             $vlist['wall_message_f'] = null;
             $vlist['__v_button'] = 'Send';
             return $vlist;
         case "skeleton":
             $vlist['skeletonarchive'] = array('M', null);
             $vlist['skeletonarchive_f'] = null;
//.........这里部分代码省略.........
开发者ID:soar-team,项目名称:kloxo,代码行数:101,代码来源:clientcorelib.php

示例13: setInternalParam

 public function setInternalParam($mountpoint)
 {
     $name = $this->main->ostemplate;
     if ($this->main->isWindows()) {
         return;
     }
     if (!$mountpoint) {
         return;
     }
     if ($name === 'unknown') {
         return;
     }
     $name = strtolower($name);
     $mountpoint = expand_real_root($mountpoint);
     $result = $this->getScriptS($name);
     dprint("Distro Name {$name}, Scripts: \n");
     dprintr($result);
     $init = strtilfirst($name, "-");
     dprint("File is  {$init}.inittab\n");
     if (lxfile_exists("../file/sysfile/inittab/{$init}.inittab")) {
         dprint("Copying {$init}.inittab\n");
         $content = lfile_get_contents("../file/sysfile/inittab/{$init}.inittab");
         if ($this->main->text_inittab) {
             $content .= "\n{$this->main->text_inittab}";
         }
         lfile_put_contents("{$mountpoint}/etc/inittab", $content);
     }
     $iplist = get_namelist_from_objectlist($this->main->vmipaddress_a);
     if ($this->main->mainipaddress) {
         $main_ip = $this->main->mainipaddress;
         $iplist = array_remove($iplist, $main_ip);
     } else {
         $main_ip = array_shift($iplist);
     }
     if ($this->main->networknetmask) {
         $main_netmask = $this->main->networknetmask;
     } else {
         $main_netmask = "255.255.255.0";
     }
     $iplist = implode(" ", $iplist);
     $ipadd = $result['ADD_IP'];
     $sethostname = $result['SET_HOSTNAME'];
     $setuserpass = $result['SET_USERPASS'];
     $ipdel = $result['DEL_IP'];
     if ($this->main->networkgateway) {
         $gw = $this->main->networkgateway;
     } else {
         $gw = os_get_network_gateway();
     }
     $gwn = strtil($gw, '.') . '.0';
     $hostname = $this->main->hostname;
     if (!$hostname) {
         $hostname = os_get_hostname();
     }
     if ($result['STARTUP_SCRIPT'] != 'systemd') {
         $name = createTempDir("{$mountpoint}/tmp", 'xen-scripts');
         lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/functions", $name);
         lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$ipadd}", $name);
         lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$sethostname}", $name);
         lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$setuserpass}", $name);
         lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$ipdel}", $name);
         $basepath = strfrom($name, $mountpoint);
         lfile_put_contents("{$name}/tmpfile.sh", "source /{$basepath}/functions\nsource /{$basepath}/{$ipdel}\n");
         $delipstring = "IPDELALL=yes chroot {$mountpoint} bash /{$basepath}/tmpfile.sh";
         log_shell($delipstring);
         log_shell(system($delipstring, $ret1) . ":return {$ret1}");
         putenv("VE_STATE=stopped");
         lfile_put_contents("{$name}/tmpfile.sh", "source /{$basepath}/functions\n source /{$basepath}/{$ipadd}\n");
         $string = "IPDELALL=yes MAIN_NETMASK={$main_netmask} MAIN_IP_ADDRESS={$main_ip} IP_ADDR=\"{$iplist}\" NETWORK_GATEWAY={$gw} NETWORK_GATEWAY_NET={$gwn} chroot {$mountpoint} bash /{$basepath}/tmpfile.sh";
         log_shell($string);
         log_shell(system($string, $ret1) . ":return {$ret1}");
         lfile_put_contents("{$name}/tmpfile.sh", "source /{$basepath}/functions\n source /{$basepath}/{$sethostname}\n");
         $string = "HOSTNM={$hostname} chroot {$mountpoint} bash /{$basepath}/tmpfile.sh";
         log_shell($string);
         log_shell(system($string, $ret1) . ":return {$ret1}");
         if ($this->main->subaction === 'rebuild' || $this->main->dbaction === 'add' || $this->main->isOn('__var_rootpassword_changed') && $this->main->rootpassword) {
             $rootpass = "root:{$this->main->rootpassword}";
             lfile_put_contents("{$name}/tmpfile.sh", "source /{$basepath}/functions\n source /{$basepath}/{$setuserpass}\n");
             $string = "USERPW={$rootpass} chroot {$mountpoint} bash /{$basepath}/tmpfile.sh";
             log_shell($string);
             log_shell(system($string));
         }
         lxfile_rm_rec($name);
     } else {
         if ($result['STARTUP_SCRIPT'] == 'systemd') {
             $script_dir = createTempDir("{$mountpoint}", "hypervm-runonce");
             lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/functions", $script_dir);
             lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$ipadd}", $script_dir);
             lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$sethostname}", $script_dir);
             lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$setuserpass}", $script_dir);
             lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$ipdel}", $script_dir);
             $basepath = strfrom($script_dir, $mountpoint);
             $startupdir = 'lib/systemd/system';
             $startupscript = 'fedora-startup.service';
             $setrootpass = '';
             if ($this->main->subaction === 'rebuild' || $this->main->dbaction === 'add' || $this->main->isOn('__var_rootpassword_changed') && $this->main->rootpassword) {
                 $rootpass = "root:{$this->main->rootpassword}";
                 $setrootpass = " & USERPW={$rootpass} source {$basepath}/{$setuserpass}";
             }
             $run_once_script = "#!/bin/bash\n" . "source {$basepath}/functions\n" . '(' . "IPDELALL=yes source {$basepath}/{$ipdel}" . " & IPDELALL=yes VE_STATE=stopped MAIN_NETMASK={$main_netmask} MAIN_IP_ADDRESS={$main_ip} IP_ADDR=\"{$iplist}\" NETWORK_GATEWAY={$gw} NETWORK_GATEWAY_NET={$gwn} source {$basepath}/{$ipadd}" . " & HOSTNM={$hostname} source {$basepath}/{$sethostname}" . "{$setrootpass})\n" . "service fedora-startup disable\nrm -f /{$startupdir}/{$startupscript}\nrm -rf {$basepath}";
//.........这里部分代码省略.........
开发者ID:digideskio,项目名称:hypervm,代码行数:101,代码来源:vps__xenlib.php

示例14: emailITticket

function emailITticket($id, $scenario, $admin = false, $debug = false)
{
    global $_josh, $page;
    $ticket = db_grab('SELECT
			u.id,
			(SELECT COUNT(*) FROM users_to_modules a WHERE a.user_id = u.id AND a.module_id = 3) isUserAdmin,
			t.title,
			t.created_user,
			t.description,
			t.departmentID,
			ISNULL(u.nickname, u.firstname) first,
			u.lastname last,
			u.email,
			' . db_updated('u') . ',
			t.created_date,
			t.priorityID,
			t.statusID,
			d.shortName department,
			t.type_id,
			y.description type,
			u2.email as ownerEmail,
			t.ownerID,
			ISNULL(u2.nickname, u2.firstname) as ownerName
		FROM helpdesk_tickets t
		LEFT JOIN helpdesk_tickets_types y	ON t.type_id = y.id
		JOIN users u ON t.created_user = u.id
		JOIN departments d ON t.departmentID = d.departmentID
		LEFT JOIN users u2 ON t.ownerID = u2.id
		WHERE t.id = ' . $id);
    //yellow box
    if ($scenario == "followup") {
        $subject = "Followup On Your Helpdesk Ticket";
        $message = drawMessage('There\'s been followup on your Helpdesk ticket - please see below.  <b>Don\'t reply to this email!</b>  Instead, please ' . draw_link('/helpdesk/ticket.php?id=' . $id, 'view your ticket') . ' in the intranet ticketing system.<br><br><b>Note:</b> if you add this sender to your "safe senders list," pictures will always download.');
    } elseif ($scenario == "followupadmin") {
        $subject = "Admin Followup on Helpdesk Ticket";
        $message = drawMessage(draw_link('/staff/view.php?id=' . user(), $_SESSION['full_name']) . ' just made an administrative followup on this Helpdesk ticket.  Regular staff were not copied on this message.');
    } elseif ($scenario == "closed") {
        $subject = "Your Ticket Has Been Closed";
        $message = drawMessage('This is to let you know that your ticket has been closed.  <b>Don\'t reply to this email!</b>  You can still followup on this thread by ' . draw_link('/helpdesk/ticket.php?id=' . $id, 'viewing your ticket') . ' in the intranet ticketing system.<br><br><b>Note:</b> if you add this sender to your "safe senders list," pictures will always download.');
    } elseif ($scenario == "assign") {
        $subject = "Your Ticket Has Been Assigned";
        $message = drawMessage(draw_link('/staff/view.php?id=' . user(), $_SESSION["full_name"]) . ' has assigned this ticket to ' . draw_link('/staff/view.php?id=' . $ticket['ownerID'], $ticket["ownerName"]) . '<b>Don\'t reply to this email!</b>  Instead, please ' . draw_link('/helpdesk/ticket.php?id=' . $id, 'view your ticket') . ' in the intranet ticketing system.<br><br><b>Note:</b> if you add this sender to your "safe senders list," pictures will always download.');
    } elseif ($scenario == "new") {
        $subject = "New " . $ticket["department"] . " Ticket Posted";
        $message = drawMessage('This is to let you know that a new ticket has just been posted to the Helpdesk.  You can ' . draw_link('/helpdesk/ticket.php?id=' . $id, 'view the ticket') . ' in the intranet ticketing system.');
    } elseif ($scenario == "critical") {
        $subject = "Critical " . $ticket["department"] . " Ticket Still Open";
        $message = drawMessage('A ticket flagged "Critical" is open on the Helpdesk.  You can ' . draw_link('/helpdesk/ticket.php?id=' . $id, 'view the ticket') . ' in the intranet ticketing system.');
    }
    //$message .= drawtableStart() . drawHeaderRow(false, 2);
    //recipients arrays
    $users = array();
    $admins = array();
    if ($ticket["isUserAdmin"]) {
        $admins[] = $ticket["email"];
    } else {
        $users[] = $ticket["email"];
    }
    if ($page['is_admin']) {
        $admins[] = $_SESSION["email"];
    } else {
        $users[] = $_SESSION["email"];
    }
    //add owner if ticket is assigned
    if ($ticket["ownerEmail"]) {
        $admins[] = $ticket["ownerEmail"];
    }
    //owner logically has to be admin
    $d_user = new display($page['breadcrumbs'] . $ticket['title'], false, false, 'thread');
    $d_admin = new display($page['breadcrumbs'] . $ticket['title'], false, false, 'thread');
    $d_user->row(drawName($ticket['created_user'], $ticket['first'] . ' ' . $ticket['last'], $ticket['created_date'], true, BR, $ticket['updated']), draw_h1($ticket['title']) . $ticket['description']);
    $d_admin->row(drawName($ticket['created_user'], $ticket['first'] . ' ' . $ticket['last'], $ticket['created_date'], true, BR, $ticket['updated']), draw_h1($ticket['title']) . $ticket['description']);
    //get followups
    $followups = db_query('SELECT
			u.id,
			f.message,
			(SELECT COUNT(*) FROM users_to_modules u2m WHERE u2m.user_id = u.id AND u2m.module_id = 3 AND u2m.is_admin = 1) isUserAdmin,
			ISNULL(u.nickname, u.firstname) firstname,
			u.lastname,
			u.email,
			f.created_date,
			f.is_admin,
			f.created_user,
			' . db_updated('u') . '
		FROM helpdesk_tickets_followups f
		INNER JOIN users  u  ON f.created_user	= u.id
		WHERE f.ticketID = ' . $id . ' ORDER BY f.created_date');
    while ($f = db_fetch($followups)) {
        $d_admin->row(drawName($f['created_user'], $f['firstname'] . ' ' . $f['lastname'], $f['created_date'], true, BR, $f['updated']), $f['message']);
        if (!$f['is_admin']) {
            $d_user->row(drawName($f['created_user'], $f['firstname'] . ' ' . $f['lastname'], $f['created_date'], true, BR, $f['updated']), $f['message']);
        }
        if ($f['isUserAdmin']) {
            $admins[] = $f['email'];
        } else {
            $users[] = $f['email'];
        }
    }
    $admins = array_remove($_SESSION['email'], array_unique($admins));
    $users = array_remove($_SESSION['email'], array_unique($users));
//.........这里部分代码省略.........
开发者ID:Rhenan,项目名称:intranet-1,代码行数:101,代码来源:include.php

示例15: submitButton

/**
 * Overloaded version of Html::submitButton(), adds icon option
 */
function submitButton($text, $options)
{
    $icon = array_remove($options, 'icon');
    $prefix = "<span class='glyphicon glyphicon-{$icon}'></span> ";
    return \yii\helpers\Html::submitButton($prefix . $text, $options);
}
开发者ID:NewPaltzKarateAcademy,项目名称:KIMS,代码行数:9,代码来源:globals.php


注:本文中的array_remove函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。