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


PHP in_array_nocase函数代码示例

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


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

示例1: test_in_array_nocase

 /**
  * rcube_shared.inc: in_array_nocase()
  */
 function test_in_array_nocase()
 {
     $haystack = array('Test');
     $needle = 'test';
     $result = in_array_nocase($needle, $haystack);
     $this->assertTrue($result, $title);
     $result = in_array_nocase($needle, null);
     $this->assertFalse($result, $title);
 }
开发者ID:netcon-source,项目名称:roundcubemail,代码行数:12,代码来源:Shared.php

示例2: getOptions

 /**
  * @see IDX_Panel::getOptions()
  */
 public function getOptions()
 {
     $idx = Util_IDX::getIdx();
     $db_idx = Util_IDX::getDatabase();
     $query = "SELECT DISTINCT `" . $idx->field($this->field) . "` AS `value` FROM `" . $idx->getTable() . "`" . (!empty($extra) ? ' WHERE ' . $extra : '') . " ORDER BY `" . $idx->field($this->field) . "` DESC LIMIT 20;";
     if ($result = $db_idx->query($query)) {
         while ($option = $db_idx->fetchArray($result)) {
             $options[] = $option['value'];
         }
     } else {
         return false;
     }
     if (!empty($options)) {
         $post = array();
         $confirmed = array();
         foreach ($options as $val) {
             $pre = explode(',', $val);
             //confirm and add to array
             foreach ($pre as $opt) {
                 $opt = preg_replace('/(^\\s+)|(\\s{2,})|(\\s+$)|(\\n)|(\\r)/', ' ', $opt);
                 //trim and remove exessive spacing
                 if (!in_array_nocase($opt, $confirmed) && !empty($opt)) {
                     if (!empty($filter)) {
                         if (preg_match($filter, $opt)) {
                             $confirmed[] = $opt;
                         }
                     } else {
                         $confirmed[] = $opt;
                     }
                 }
             }
         }
         //sort them
         if (!empty($confirmed)) {
             asort($confirmed);
             foreach ($confirmed as $opt) {
                 $post[] = array('value' => $opt, 'title' => ucwords(strtolower($opt)));
             }
         }
         $this->options = $post;
     } else {
         return false;
     }
     return $this->options;
 }
开发者ID:REWAdrianGalbraith,项目名称:erics-idx-collab-preston-guyton,代码行数:48,代码来源:ExteriorFeatures.php

示例3: create_default_folders

 /**
  * Create all folders specified as default
  */
 function create_default_folders()
 {
     $a_folders = iil_C_ListMailboxes($this->conn, $this->mod_mailbox(''), '*');
     $a_subscribed = iil_C_ListSubscribed($this->conn, $this->mod_mailbox(''), '*');
     // create default folders if they do not exist
     foreach ($this->default_folders as $folder) {
         $abs_name = $this->mod_mailbox($folder);
         if (!in_array_nocase($abs_name, $a_folders)) {
             $this->create_mailbox($folder, TRUE);
         } else {
             if (!in_array_nocase($abs_name, $a_subscribed)) {
                 $this->subscribe($folder);
             }
         }
     }
 }
开发者ID:ehmedov,项目名称:www,代码行数:19,代码来源:rcube_imap.php

示例4: folder_exists

 /**
  * Checks if folder exists and is subscribed
  *
  * @param string   $folder       Folder name
  * @param boolean  $subscription Enable subscription checking
  *
  * @return boolean TRUE or FALSE
  */
 public function folder_exists($folder, $subscription = false)
 {
     if ($folder == 'INBOX') {
         return true;
     }
     $key = $subscription ? 'subscribed' : 'existing';
     if (is_array($this->icache[$key]) && in_array($folder, $this->icache[$key])) {
         return true;
     }
     if (!$this->check_connection()) {
         return false;
     }
     if ($subscription) {
         // It's possible we already called LIST command, check LIST data
         if (!empty($this->conn->data['LIST']) && !empty($this->conn->data['LIST'][$folder]) && in_array_nocase('\\Subscribed', $this->conn->data['LIST'][$folder])) {
             $a_folders = array($folder);
         } else {
             $a_folders = $this->conn->listSubscribed('', $folder);
         }
     } else {
         // It's possible we already called LIST command, check LIST data
         if (!empty($this->conn->data['LIST']) && isset($this->conn->data['LIST'][$folder])) {
             $a_folders = array($folder);
         } else {
             $a_folders = $this->conn->listMailboxes('', $folder);
         }
     }
     if (is_array($a_folders) && in_array($folder, $a_folders)) {
         $this->icache[$key][] = $folder;
         return true;
     }
     return false;
 }
开发者ID:ehabqino,项目名称:roundcubemail,代码行数:41,代码来源:rcube_imap.php

示例5: check_permflag

 /**
  * Checks the PERMANENTFLAGS capability of the current folder
  * and returns true if the given flag is supported by the IMAP server
  *
  * @param string $flag Permanentflag name
  *
  * @return boolean True if this flag is supported
  */
 public function check_permflag($flag)
 {
     $flag = strtoupper($flag);
     $perm_flags = $this->get_permflags($this->folder);
     $imap_flag = $this->conn->flags[$flag];
     return $imap_flag && !empty($perm_flags) && in_array_nocase($imap_flag, $perm_flags);
 }
开发者ID:noikiy,项目名称:roundcubemail,代码行数:15,代码来源:rcube_imap.php

示例6: action_div

 function action_div($fid, $id, $div = true)
 {
     $action = isset($this->form) ? $this->form['actions'][$id] : $this->script[$fid]['actions'][$id];
     $rows_num = isset($this->form) ? sizeof($this->form['actions']) : sizeof($this->script[$fid]['actions']);
     $out = $div ? '<div class="actionrow" id="actionrow' . $id . '">' . "\n" : '';
     $out .= '<table><tr><td class="rowactions">';
     // action select
     $select_action = new html_select(array('name' => "_action_type[{$id}]", 'id' => 'action_type' . $id, 'onchange' => 'action_type_select(' . $id . ')'));
     if (in_array('fileinto', $this->exts)) {
         $select_action->add(rcube::Q($this->plugin->gettext('messagemoveto')), 'fileinto');
     }
     if (in_array('fileinto', $this->exts) && in_array('copy', $this->exts)) {
         $select_action->add(rcube::Q($this->plugin->gettext('messagecopyto')), 'fileinto_copy');
     }
     $select_action->add(rcube::Q($this->plugin->gettext('messageredirect')), 'redirect');
     if (in_array('copy', $this->exts)) {
         $select_action->add(rcube::Q($this->plugin->gettext('messagesendcopy')), 'redirect_copy');
     }
     if (in_array('reject', $this->exts)) {
         $select_action->add(rcube::Q($this->plugin->gettext('messagediscard')), 'reject');
     } else {
         if (in_array('ereject', $this->exts)) {
             $select_action->add(rcube::Q($this->plugin->gettext('messagediscard')), 'ereject');
         }
     }
     if (in_array('vacation', $this->exts)) {
         $select_action->add(rcube::Q($this->plugin->gettext('messagereply')), 'vacation');
     }
     $select_action->add(rcube::Q($this->plugin->gettext('messagedelete')), 'discard');
     if (in_array('imapflags', $this->exts) || in_array('imap4flags', $this->exts)) {
         $select_action->add(rcube::Q($this->plugin->gettext('setflags')), 'setflag');
         $select_action->add(rcube::Q($this->plugin->gettext('addflags')), 'addflag');
         $select_action->add(rcube::Q($this->plugin->gettext('removeflags')), 'removeflag');
     }
     if (in_array('variables', $this->exts)) {
         $select_action->add(rcube::Q($this->plugin->gettext('setvariable')), 'set');
     }
     if (in_array('enotify', $this->exts) || in_array('notify', $this->exts)) {
         $select_action->add(rcube::Q($this->plugin->gettext('notify')), 'notify');
     }
     $select_action->add(rcube::Q($this->plugin->gettext('messagekeep')), 'keep');
     $select_action->add(rcube::Q($this->plugin->gettext('rulestop')), 'stop');
     $select_type = $action['type'];
     if (in_array($action['type'], array('fileinto', 'redirect')) && $action['copy']) {
         $select_type .= '_copy';
     }
     $out .= $select_action->show($select_type);
     $out .= '</td>';
     // actions target inputs
     $out .= '<td class="rowtargets">';
     // force domain selection in redirect email input
     $domains = (array) $this->rc->config->get('managesieve_domains');
     if (!empty($domains)) {
         sort($domains);
         $domain_select = new html_select(array('name' => "_action_target_domain[{$id}]", 'id' => 'action_target_domain' . $id));
         $domain_select->add(array_combine($domains, $domains));
         if ($action['type'] == 'redirect') {
             $parts = explode('@', $action['target']);
             if (!empty($parts)) {
                 $action['domain'] = array_pop($parts);
                 $action['target'] = implode('@', $parts);
             }
         }
     }
     // redirect target
     $out .= '<span id="redirect_target' . $id . '" style="white-space:nowrap;' . ' display:' . ($action['type'] == 'redirect' ? 'inline' : 'none') . '">' . '<input type="text" name="_action_target[' . $id . ']" id="action_target' . $id . '"' . ' value="' . ($action['type'] == 'redirect' ? rcube::Q($action['target'], 'strict', false) : '') . '"' . (!empty($domains) ? ' size="20"' : ' size="35"') . $this->error_class($id, 'action', 'target', 'action_target') . ' />' . (!empty($domains) ? ' @ ' . $domain_select->show($action['domain']) : '') . '</span>';
     // (e)reject target
     $out .= '<textarea name="_action_target_area[' . $id . ']" id="action_target_area' . $id . '" ' . 'rows="3" cols="35" ' . $this->error_class($id, 'action', 'targetarea', 'action_target_area') . 'style="display:' . (in_array($action['type'], array('reject', 'ereject')) ? 'inline' : 'none') . '">' . (in_array($action['type'], array('reject', 'ereject')) ? rcube::Q($action['target'], 'strict', false) : '') . "</textarea>\n";
     // vacation
     $vsec = in_array('vacation-seconds', $this->exts);
     $out .= '<div id="action_vacation' . $id . '" style="display:' . ($action['type'] == 'vacation' ? 'inline' : 'none') . '">';
     $out .= '<span class="label">' . rcube::Q($this->plugin->gettext('vacationreason')) . '</span><br />' . '<textarea name="_action_reason[' . $id . ']" id="action_reason' . $id . '" ' . 'rows="3" cols="35" ' . $this->error_class($id, 'action', 'reason', 'action_reason') . '>' . Q($action['reason'], 'strict', false) . "</textarea>\n";
     $out .= '<br /><span class="label">' . rcube::Q($this->plugin->gettext('vacationsubject')) . '</span><br />' . '<input type="text" name="_action_subject[' . $id . ']" id="action_subject' . $id . '" ' . 'value="' . (is_array($action['subject']) ? rcube::Q(implode(', ', $action['subject']), 'strict', false) : $action['subject']) . '" size="35" ' . $this->error_class($id, 'action', 'subject', 'action_subject') . ' />';
     $out .= '<br /><span class="label">' . rcube::Q($this->plugin->gettext('vacationaddr')) . '</span><br />' . $this->list_input($id, 'action_addresses', $action['addresses'], true, $this->error_class($id, 'action', 'addresses', 'action_addresses'), 30);
     $out .= '<br /><span class="label">' . rcube::Q($this->plugin->gettext($vsec ? 'vacationinterval' : 'vacationdays')) . '</span><br />' . '<input type="text" name="_action_interval[' . $id . ']" id="action_interval' . $id . '" ' . 'value="' . rcube::Q(isset($action['seconds']) ? $action['seconds'] : $action['days'], 'strict', false) . '" size="2" ' . $this->error_class($id, 'action', 'interval', 'action_interval') . ' />';
     if ($vsec) {
         $out .= '&nbsp;<label><input type="radio" name="_action_interval_type[' . $id . ']" value="days"' . (!isset($action['seconds']) ? ' checked="checked"' : '') . ' class="radio" />' . $this->plugin->gettext('days') . '</label>' . '&nbsp;<label><input type="radio" name="_action_interval_type[' . $id . ']" value="seconds"' . (isset($action['seconds']) ? ' checked="checked"' : '') . ' class="radio" />' . $this->plugin->gettext('seconds') . '</label>';
     }
     $out .= '</div>';
     // flags
     $flags = array('read' => '\\Seen', 'answered' => '\\Answered', 'flagged' => '\\Flagged', 'deleted' => '\\Deleted', 'draft' => '\\Draft');
     $flags_target = (array) $action['target'];
     $out .= '<div id="action_flags' . $id . '" style="display:' . (preg_match('/^(set|add|remove)flag$/', $action['type']) ? 'inline' : 'none') . '"' . $this->error_class($id, 'action', 'flags', 'action_flags') . '>';
     foreach ($flags as $fidx => $flag) {
         $out .= '<input type="checkbox" name="_action_flags[' . $id . '][]" value="' . $flag . '"' . (in_array_nocase($flag, $flags_target) ? 'checked="checked"' : '') . ' />' . rcube::Q($this->plugin->gettext('flag' . $fidx)) . '<br>';
     }
     $out .= '</div>';
     // set variable
     $set_modifiers = array('lower', 'upper', 'lowerfirst', 'upperfirst', 'quotewildcard', 'length');
     $out .= '<div id="action_set' . $id . '" style="display:' . ($action['type'] == 'set' ? 'inline' : 'none') . '">';
     $out .= '<span class="label">' . rcube::Q($this->plugin->gettext('setvarname')) . '</span><br />' . '<input type="text" name="_action_varname[' . $id . ']" id="action_varname' . $id . '" ' . 'value="' . rcube::Q($action['name']) . '" size="35" ' . $this->error_class($id, 'action', 'name', 'action_varname') . ' />';
     $out .= '<br /><span class="label">' . rcube::Q($this->plugin->gettext('setvarvalue')) . '</span><br />' . '<input type="text" name="_action_varvalue[' . $id . ']" id="action_varvalue' . $id . '" ' . 'value="' . rcube::Q($action['value']) . '" size="35" ' . $this->error_class($id, 'action', 'value', 'action_varvalue') . ' />';
     $out .= '<br /><span class="label">' . rcube::Q($this->plugin->gettext('setvarmodifiers')) . '</span><br />';
     foreach ($set_modifiers as $s_m) {
         $s_m_id = 'action_varmods' . $id . $s_m;
         $out .= sprintf('<input type="checkbox" name="_action_varmods[%s][]" value="%s" id="%s"%s />%s<br>', $id, $s_m, $s_m_id, array_key_exists($s_m, (array) $action) && $action[$s_m] ? ' checked="checked"' : '', rcube::Q($this->plugin->gettext('var' . $s_m)));
     }
     $out .= '</div>';
     // notify
     $notify_methods = (array) $this->rc->config->get('managesieve_notify_methods');
//.........这里部分代码省略.........
开发者ID:zamentur,项目名称:roundcube_ynh,代码行数:101,代码来源:rcube_sieve_engine.php

示例7: get_type_index

 /**
  * Find index with the '$type' attribute
  *
  * @param string Field name
  * @return int Field index having $type set
  */
 private function get_type_index($field, $type = 'pref')
 {
     $result = 0;
     if ($this->raw[$field]) {
         foreach ($this->raw[$field] as $i => $data) {
             if (is_array($data['type']) && in_array_nocase('pref', $data['type'])) {
                 $result = $i;
             }
         }
     }
     return $result;
 }
开发者ID:rootsdigital,项目名称:roundcubemail,代码行数:18,代码来源:rcube_vcard.php

示例8: autoselect_host

 /**
  * Auto-select IMAP host based on the posted login information
  *
  * @return string Selected IMAP host
  */
 public function autoselect_host()
 {
     $default_host = $this->config->get('default_host');
     $host = null;
     if (is_array($default_host)) {
         $post_host = rcube_utils::get_input_value('_host', rcube_utils::INPUT_POST);
         $post_user = rcube_utils::get_input_value('_user', rcube_utils::INPUT_POST);
         list($user, $domain) = explode('@', $post_user);
         // direct match in default_host array
         if ($default_host[$post_host] || in_array($post_host, array_values($default_host))) {
             $host = $post_host;
         } else {
             if (!empty($domain)) {
                 foreach ($default_host as $storage_host => $mail_domains) {
                     if (is_array($mail_domains) && in_array_nocase($domain, $mail_domains)) {
                         $host = $storage_host;
                         break;
                     } else {
                         if (stripos($storage_host, $domain) !== false || stripos(strval($mail_domains), $domain) !== false) {
                             $host = is_numeric($storage_host) ? $mail_domains : $storage_host;
                             break;
                         }
                     }
                 }
             }
         }
         // take the first entry if $host is still not set
         if (empty($host)) {
             list($key, $val) = each($default_host);
             $host = is_numeric($key) ? $val : $key;
         }
     } else {
         if (empty($default_host)) {
             $host = rcube_utils::get_input_value('_host', rcube_utils::INPUT_POST);
         } else {
             $host = rcube_utils::parse_host($default_host);
         }
     }
     return $host;
 }
开发者ID:npk,项目名称:roundcubemail,代码行数:45,代码来源:rcmail.php

示例9: check_permflag

 /**
  * Checks the PERMANENTFLAGS capability of the current mailbox
  * and returns true if the given flag is supported by the IMAP server
  *
  * @param   string  Permanentflag name
  * @return  mixed   True if this flag is supported
  * @access  public
  */
 function check_permflag($flag)
 {
     $flag = strtoupper($flag);
     $imap_flag = $this->conn->flags[$flag];
     return in_array_nocase($imap_flag, $this->conn->permanentflags);
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:14,代码来源:rcube_imap.php

示例10: action_div

 function action_div($fid, $id, $div = true)
 {
     $action = isset($this->form) ? $this->form['actions'][$id] : $this->script[$fid]['actions'][$id];
     $rows_num = isset($this->form) ? sizeof($this->form['actions']) : sizeof($this->script[$fid]['actions']);
     $out = $div ? '<div class="actionrow" id="actionrow' . $id . '">' . "\n" : '';
     $out .= '<table><tr><td class="rowactions">';
     // action select
     $select_action = new html_select(array('name' => "_action_type[{$id}]", 'id' => 'action_type' . $id, 'onchange' => 'action_type_select(' . $id . ')'));
     if (in_array('fileinto', $this->exts)) {
         $select_action->add(Q($this->gettext('messagemoveto')), 'fileinto');
     }
     if (in_array('fileinto', $this->exts) && in_array('copy', $this->exts)) {
         $select_action->add(Q($this->gettext('messagecopyto')), 'fileinto_copy');
     }
     $select_action->add(Q($this->gettext('messageredirect')), 'redirect');
     if (in_array('copy', $this->exts)) {
         $select_action->add(Q($this->gettext('messagesendcopy')), 'redirect_copy');
     }
     if (in_array('reject', $this->exts)) {
         $select_action->add(Q($this->gettext('messagediscard')), 'reject');
     } else {
         if (in_array('ereject', $this->exts)) {
             $select_action->add(Q($this->gettext('messagediscard')), 'ereject');
         }
     }
     if (in_array('vacation', $this->exts)) {
         $select_action->add(Q($this->gettext('messagereply')), 'vacation');
     }
     $select_action->add(Q($this->gettext('messagedelete')), 'discard');
     if (in_array('imapflags', $this->exts) || in_array('imap4flags', $this->exts)) {
         $select_action->add(Q($this->gettext('setflags')), 'setflag');
         $select_action->add(Q($this->gettext('addflags')), 'addflag');
         $select_action->add(Q($this->gettext('removeflags')), 'removeflag');
     }
     $select_action->add(Q($this->gettext('rulestop')), 'stop');
     $select_type = $action['type'];
     if (in_array($action['type'], array('fileinto', 'redirect')) && $action['copy']) {
         $select_type .= '_copy';
     }
     $out .= $select_action->show($select_type);
     $out .= '</td>';
     // actions target inputs
     $out .= '<td class="rowtargets">';
     // shared targets
     $out .= '<input type="text" name="_action_target[' . $id . ']" id="action_target' . $id . '" ' . 'value="' . ($action['type'] == 'redirect' ? Q($action['target'], 'strict', false) : '') . '" size="35" ' . 'style="display:' . ($action['type'] == 'redirect' ? 'inline' : 'none') . '" ' . $this->error_class($id, 'action', 'target', 'action_target') . ' />';
     $out .= '<textarea name="_action_target_area[' . $id . ']" id="action_target_area' . $id . '" ' . 'rows="3" cols="35" ' . $this->error_class($id, 'action', 'targetarea', 'action_target_area') . 'style="display:' . (in_array($action['type'], array('reject', 'ereject')) ? 'inline' : 'none') . '">' . (in_array($action['type'], array('reject', 'ereject')) ? Q($action['target'], 'strict', false) : '') . "</textarea>\n";
     // vacation
     $out .= '<div id="action_vacation' . $id . '" style="display:' . ($action['type'] == 'vacation' ? 'inline' : 'none') . '">';
     $out .= '<span class="label">' . Q($this->gettext('vacationreason')) . '</span><br />' . '<textarea name="_action_reason[' . $id . ']" id="action_reason' . $id . '" ' . 'rows="3" cols="35" ' . $this->error_class($id, 'action', 'reason', 'action_reason') . '>' . Q($action['reason'], 'strict', false) . "</textarea>\n";
     $out .= '<br /><span class="label">' . Q($this->gettext('vacationsubject')) . '</span><br />' . '<input type="text" name="_action_subject[' . $id . ']" id="action_subject' . $id . '" ' . 'value="' . (is_array($action['subject']) ? Q(implode(', ', $action['subject']), 'strict', false) : $action['subject']) . '" size="35" ' . $this->error_class($id, 'action', 'subject', 'action_subject') . ' />';
     $out .= '<br /><span class="label">' . Q($this->gettext('vacationaddresses')) . '</span><br />' . '<input type="text" name="_action_addresses[' . $id . ']" id="action_addr' . $id . '" ' . 'value="' . (is_array($action['addresses']) ? Q(implode(', ', $action['addresses']), 'strict', false) : $action['addresses']) . '" size="35" ' . $this->error_class($id, 'action', 'addresses', 'action_addr') . ' />';
     $out .= '<br /><span class="label">' . Q($this->gettext('vacationdays')) . '</span><br />' . '<input type="text" name="_action_days[' . $id . ']" id="action_days' . $id . '" ' . 'value="' . Q($action['days'], 'strict', false) . '" size="2" ' . $this->error_class($id, 'action', 'days', 'action_days') . ' />';
     $out .= '</div>';
     // flags
     $flags = array('read' => '\\Seen', 'answered' => '\\Answered', 'flagged' => '\\Flagged', 'deleted' => '\\Deleted', 'draft' => '\\Draft');
     $flags_target = (array) $action['target'];
     $out .= '<div id="action_flags' . $id . '" style="display:' . (preg_match('/^(set|add|remove)flag$/', $action['type']) ? 'inline' : 'none') . '"' . $this->error_class($id, 'action', 'flags', 'action_flags') . '>';
     foreach ($flags as $fidx => $flag) {
         $out .= '<input type="checkbox" name="_action_flags[' . $id . '][]" value="' . $flag . '"' . (in_array_nocase($flag, $flags_target) ? 'checked="checked"' : '') . ' />' . Q($this->gettext('flag' . $fidx)) . '<br>';
     }
     $out .= '</div>';
     // mailbox select
     if ($action['type'] == 'fileinto') {
         $mailbox = $this->mod_mailbox($action['target'], 'out');
     } else {
         $mailbox = '';
     }
     $select = rcmail_mailbox_select(array('realnames' => false, 'maxlength' => 100, 'id' => 'action_mailbox' . $id, 'name' => "_action_mailbox[{$id}]", 'style' => 'display:' . (!isset($action) || $action['type'] == 'fileinto' ? 'inline' : 'none')));
     $out .= $select->show($mailbox);
     $out .= '</td>';
     // add/del buttons
     $out .= '<td class="rowbuttons">';
     $out .= '<a href="#" id="actionadd' . $id . '" title="' . Q($this->gettext('add')) . '"
         onclick="rcmail.managesieve_actionadd(' . $id . ')" class="button add"></a>';
     $out .= '<a href="#" id="actiondel' . $id . '" title="' . Q($this->gettext('del')) . '"
         onclick="rcmail.managesieve_actiondel(' . $id . ')" class="button del' . ($rows_num < 2 ? ' disabled' : '') . '"></a>';
     $out .= '</td>';
     $out .= '</tr></table>';
     $out .= $div ? "</div>\n" : '';
     return $out;
 }
开发者ID:npk,项目名称:roundcubemail,代码行数:81,代码来源:managesieve.php

示例11: action_div

 function action_div($fid, $id, $div = true)
 {
     $action = isset($this->form) ? $this->form['actions'][$id] : $this->script[$fid]['actions'][$id];
     $rows_num = isset($this->form) ? sizeof($this->form['actions']) : sizeof($this->script[$fid]['actions']);
     $out = $div ? '<div class="actionrow" id="actionrow' . $id . '">' . "\n" : '';
     $out .= '<table><tr><td class="rowactions">';
     // action select
     $select_action = new html_select(array('name' => "_action_type[{$id}]", 'id' => 'action_type' . $id, 'onchange' => 'action_type_select(' . $id . ')'));
     if (in_array('fileinto', $this->exts)) {
         $select_action->add(Q($this->gettext('messagemoveto')), 'fileinto');
     }
     if (in_array('fileinto', $this->exts) && in_array('copy', $this->exts)) {
         $select_action->add(Q($this->gettext('messagecopyto')), 'fileinto_copy');
     }
     $select_action->add(Q($this->gettext('messageredirect')), 'redirect');
     if (in_array('copy', $this->exts)) {
         $select_action->add(Q($this->gettext('messagesendcopy')), 'redirect_copy');
     }
     if (in_array('reject', $this->exts)) {
         $select_action->add(Q($this->gettext('messagediscard')), 'reject');
     } else {
         if (in_array('ereject', $this->exts)) {
             $select_action->add(Q($this->gettext('messagediscard')), 'ereject');
         }
     }
     if (in_array('vacation', $this->exts)) {
         $select_action->add(Q($this->gettext('messagereply')), 'vacation');
     }
     $select_action->add(Q($this->gettext('messagedelete')), 'discard');
     if (in_array('imapflags', $this->exts) || in_array('imap4flags', $this->exts)) {
         $select_action->add(Q($this->gettext('setflags')), 'setflag');
         $select_action->add(Q($this->gettext('addflags')), 'addflag');
         $select_action->add(Q($this->gettext('removeflags')), 'removeflag');
     }
     if (in_array('variables', $this->exts)) {
         $select_action->add(Q($this->gettext('setvariable')), 'set');
     }
     if (in_array('enotify', $this->exts) || in_array('notify', $this->exts)) {
         $select_action->add(Q($this->gettext('notify')), 'notify');
     }
     $select_action->add(Q($this->gettext('rulestop')), 'stop');
     $select_type = $action['type'];
     if (in_array($action['type'], array('fileinto', 'redirect')) && $action['copy']) {
         $select_type .= '_copy';
     }
     $out .= $select_action->show($select_type);
     $out .= '</td>';
     // actions target inputs
     $out .= '<td class="rowtargets">';
     // shared targets
     $out .= '<input type="text" name="_action_target[' . $id . ']" id="action_target' . $id . '" ' . 'value="' . ($action['type'] == 'redirect' ? Q($action['target'], 'strict', false) : '') . '" size="35" ' . 'style="display:' . ($action['type'] == 'redirect' ? 'inline' : 'none') . '" ' . $this->error_class($id, 'action', 'target', 'action_target') . ' />';
     $out .= '<textarea name="_action_target_area[' . $id . ']" id="action_target_area' . $id . '" ' . 'rows="3" cols="35" ' . $this->error_class($id, 'action', 'targetarea', 'action_target_area') . 'style="display:' . (in_array($action['type'], array('reject', 'ereject')) ? 'inline' : 'none') . '">' . (in_array($action['type'], array('reject', 'ereject')) ? Q($action['target'], 'strict', false) : '') . "</textarea>\n";
     // vacation
     $out .= '<div id="action_vacation' . $id . '" style="display:' . ($action['type'] == 'vacation' ? 'inline' : 'none') . '">';
     $out .= '<span class="label">' . Q($this->gettext('vacationreason')) . '</span><br />' . '<textarea name="_action_reason[' . $id . ']" id="action_reason' . $id . '" ' . 'rows="3" cols="35" ' . $this->error_class($id, 'action', 'reason', 'action_reason') . '>' . Q($action['reason'], 'strict', false) . "</textarea>\n";
     $out .= '<br /><span class="label">' . Q($this->gettext('vacationsubject')) . '</span><br />' . '<input type="text" name="_action_subject[' . $id . ']" id="action_subject' . $id . '" ' . 'value="' . (is_array($action['subject']) ? Q(implode(', ', $action['subject']), 'strict', false) : $action['subject']) . '" size="35" ' . $this->error_class($id, 'action', 'subject', 'action_subject') . ' />';
     $out .= '<br /><span class="label">' . Q($this->gettext('vacationaddresses')) . '</span><br />' . '<input type="text" name="_action_addresses[' . $id . ']" id="action_addr' . $id . '" ' . 'value="' . (is_array($action['addresses']) ? Q(implode(', ', $action['addresses']), 'strict', false) : $action['addresses']) . '" size="35" ' . $this->error_class($id, 'action', 'addresses', 'action_addr') . ' />';
     $out .= '<br /><span class="label">' . Q($this->gettext('vacationdays')) . '</span><br />' . '<input type="text" name="_action_days[' . $id . ']" id="action_days' . $id . '" ' . 'value="' . Q($action['days'], 'strict', false) . '" size="2" ' . $this->error_class($id, 'action', 'days', 'action_days') . ' />';
     $out .= '</div>';
     // flags
     $flags = array('read' => '\\Seen', 'answered' => '\\Answered', 'flagged' => '\\Flagged', 'deleted' => '\\Deleted', 'draft' => '\\Draft');
     $flags_target = (array) $action['target'];
     $out .= '<div id="action_flags' . $id . '" style="display:' . (preg_match('/^(set|add|remove)flag$/', $action['type']) ? 'inline' : 'none') . '"' . $this->error_class($id, 'action', 'flags', 'action_flags') . '>';
     foreach ($flags as $fidx => $flag) {
         $out .= '<input type="checkbox" name="_action_flags[' . $id . '][]" value="' . $flag . '"' . (in_array_nocase($flag, $flags_target) ? 'checked="checked"' : '') . ' />' . Q($this->gettext('flag' . $fidx)) . '<br>';
     }
     $out .= '</div>';
     // set variable
     $set_modifiers = array('lower', 'upper', 'lowerfirst', 'upperfirst', 'quotewildcard', 'length');
     $out .= '<div id="action_set' . $id . '" style="display:' . ($action['type'] == 'set' ? 'inline' : 'none') . '">';
     $out .= '<span class="label">' . Q($this->gettext('setvarname')) . '</span><br />' . '<input type="text" name="_action_varname[' . $id . ']" id="action_varname' . $id . '" ' . 'value="' . Q($action['name']) . '" size="35" ' . $this->error_class($id, 'action', 'name', 'action_varname') . ' />';
     $out .= '<br /><span class="label">' . Q($this->gettext('setvarvalue')) . '</span><br />' . '<input type="text" name="_action_varvalue[' . $id . ']" id="action_varvalue' . $id . '" ' . 'value="' . Q($action['value']) . '" size="35" ' . $this->error_class($id, 'action', 'value', 'action_varvalue') . ' />';
     $out .= '<br /><span class="label">' . Q($this->gettext('setvarmodifiers')) . '</span><br />';
     foreach ($set_modifiers as $j => $s_m) {
         $s_m_id = 'action_varmods' . $id . $s_m;
         $out .= sprintf('<input type="checkbox" name="_action_varmods[%s][]" value="%s" id="%s"%s />%s<br>', $id, $s_m, $s_m_id, array_key_exists($s_m, (array) $action) && $action[$s_m] ? ' checked="checked"' : '', Q($this->gettext('var' . $s_m)));
     }
     $out .= '</div>';
     // notify
     // skip :options tag - not used by the mailto method
     $out .= '<div id="action_notify' . $id . '" style="display:' . ($action['type'] == 'notify' ? 'inline' : 'none') . '">';
     $out .= '<span class="label">' . Q($this->gettext('notifyaddress')) . '</span><br />' . '<input type="text" name="_action_notifyaddress[' . $id . ']" id="action_notifyaddress' . $id . '" ' . 'value="' . Q($action['address']) . '" size="35" ' . $this->error_class($id, 'action', 'address', 'action_notifyaddress') . ' />';
     $out .= '<br /><span class="label">' . Q($this->gettext('notifybody')) . '</span><br />' . '<textarea name="_action_notifybody[' . $id . ']" id="action_notifybody' . $id . '" ' . 'rows="3" cols="35" ' . $this->error_class($id, 'action', 'method', 'action_notifybody') . '>' . Q($action['body'], 'strict', false) . "</textarea>\n";
     $out .= '<br /><span class="label">' . Q($this->gettext('notifysubject')) . '</span><br />' . '<input type="text" name="_action_notifymessage[' . $id . ']" id="action_notifymessage' . $id . '" ' . 'value="' . Q($action['message']) . '" size="35" ' . $this->error_class($id, 'action', 'message', 'action_notifymessage') . ' />';
     $out .= '<br /><span class="label">' . Q($this->gettext('notifyfrom')) . '</span><br />' . '<input type="text" name="_action_notifyfrom[' . $id . ']" id="action_notifyfrom' . $id . '" ' . 'value="' . Q($action['from']) . '" size="35" ' . $this->error_class($id, 'action', 'from', 'action_notifyfrom') . ' />';
     $importance_options = array(3 => 'notifyimportancelow', 2 => 'notifyimportancenormal', 1 => 'notifyimportancehigh');
     $select_importance = new html_select(array('name' => '_action_notifyimportance[' . $id . ']', 'id' => '_action_notifyimportance' . $id, 'class' => $this->error_class($id, 'action', 'importance', 'action_notifyimportance')));
     foreach ($importance_options as $io_v => $io_n) {
         $select_importance->add(Q($this->gettext($io_n)), $io_v);
     }
     $out .= '<br /><span class="label">' . Q($this->gettext('notifyimportance')) . '</span><br />';
     $out .= $select_importance->show($action['importance'] ? $action['importance'] : 2);
     $out .= '</div>';
     // mailbox select
     if ($action['type'] == 'fileinto') {
         $mailbox = $this->mod_mailbox($action['target'], 'out');
     } else {
         $mailbox = '';
     }
     $select = rcmail_mailbox_select(array('realnames' => false, 'maxlength' => 100, 'id' => 'action_mailbox' . $id, 'name' => "_action_mailbox[{$id}]", 'style' => 'display:' . (!isset($action) || $action['type'] == 'fileinto' ? 'inline' : 'none')));
//.........这里部分代码省略.........
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:101,代码来源:managesieve.php

示例12: action_div


//.........这里部分代码省略.........
     $auto_addr = $this->rc->config->get('managesieve_vacation_addresses_init');
     $from_addr = $this->rc->config->get('managesieve_vacation_from_init');
     if (empty($action)) {
         if ($auto_addr) {
             $action['addresses'] = $this->user_emails();
         }
         if ($from_addr) {
             $default_identity = $this->rc->user->list_emails(true);
             $action['from'] = $default_identity['email'];
         }
     }
     $out .= '<div id="action_vacation' . $id . '" style="display:' . ($action['type'] == 'vacation' ? 'inline' : 'none') . '">';
     $out .= '<span class="label">' . rcube::Q($this->plugin->gettext('vacationreason')) . '</span><br>';
     $out .= html::tag('textarea', array('name' => '_action_reason[' . $id . ']', 'id' => 'action_reason' . $id, 'rows' => 3, 'cols' => 35, 'class' => $this->error_class($id, 'action', 'reason', 'action_reason')), rcube::Q($action['reason'], 'strict', false));
     $out .= '<br><span class="label">' . rcube::Q($this->plugin->gettext('vacationsubject')) . '</span><br>';
     $out .= html::tag('input', array('type' => 'text', 'name' => '_action_subject[' . $id . ']', 'id' => 'action_subject' . $id, 'value' => is_array($action['subject']) ? implode(', ', $action['subject']) : $action['subject'], 'size' => 35, 'class' => $this->error_class($id, 'action', 'subject', 'action_subject')));
     $out .= '<br><span class="label">' . rcube::Q($this->plugin->gettext('vacationfrom')) . '</span><br>';
     $out .= html::tag('input', array('type' => 'text', 'name' => '_action_from[' . $id . ']', 'id' => 'action_from' . $id, 'value' => $action['from'], 'size' => 35, 'class' => $this->error_class($id, 'action', 'from', 'action_from')));
     $out .= '<br><span class="label">' . rcube::Q($this->plugin->gettext('vacationaddr')) . '</span><br>';
     $out .= $this->list_input($id, 'action_addresses', $action['addresses'], true, $this->error_class($id, 'action', 'addresses', 'action_addresses'), 30) . html::a(array('href' => '#', 'onclick' => rcmail_output::JS_OBJECT_NAME . ".managesieve_vacation_addresses({$id})"), rcube::Q($this->plugin->gettext('filladdresses')));
     $out .= '<br><span class="label">' . rcube::Q($this->plugin->gettext($vsec ? 'vacationinterval' : 'vacationdays')) . '</span><br>';
     $out .= html::tag('input', array('type' => 'text', 'name' => '_action_interval[' . $id . ']', 'id' => 'action_interval' . $id, 'value' => rcube_sieve_vacation::vacation_interval($action), 'size' => 2, 'class' => $this->error_class($id, 'action', 'interval', 'action_interval')));
     if ($vsec) {
         foreach (array('days', 'seconds') as $unit) {
             $out .= '&nbsp;' . html::label(null, html::tag('input', array('type' => 'radio', 'name' => '_action_interval_type[' . $id . ']', 'value' => $unit, 'checked' => $unit == 'seconds' && isset($action['seconds']) || $unit == 'deys' && !isset($action['seconds']), 'class' => 'radio')) . $this->plugin->gettext($unit));
         }
     }
     $out .= '</div>';
     // flags
     $flags = array('read' => '\\Seen', 'answered' => '\\Answered', 'flagged' => '\\Flagged', 'deleted' => '\\Deleted', 'draft' => '\\Draft');
     $flags_target = (array) $action['target'];
     $flout = '';
     foreach ($flags as $fidx => $flag) {
         $flout .= html::tag('input', array('type' => 'checkbox', 'name' => '_action_flags[' . $id . '][]', 'value' => $flag, 'checked' => in_array_nocase($flag, $flags_target))) . rcube::Q($this->plugin->gettext('flag' . $fidx)) . '<br>';
     }
     $out .= html::div(array('id' => 'action_flags' . $id, 'style' => 'display:' . (preg_match('/^(set|add|remove)flag$/', $action['type']) ? 'inline' : 'none'), 'class' => $this->error_class($id, 'action', 'flags', 'action_flags')), $flout);
     // set variable
     $set_modifiers = array('lower', 'upper', 'lowerfirst', 'upperfirst', 'quotewildcard', 'length');
     $out .= '<div id="action_set' . $id . '" style="display:' . ($action['type'] == 'set' ? 'inline' : 'none') . '">';
     foreach (array('name', 'value') as $unit) {
         $out .= '<span class="label">' . rcube::Q($this->plugin->gettext('setvar' . $unit)) . '</span><br>';
         $out .= html::tag('input', array('type' => 'text', 'name' => '_action_var' . $unit . '[' . $id . ']', 'id' => 'action_var' . $unit . $id, 'value' => $action[$unit], 'size' => 35, 'class' => $this->error_class($id, 'action', $unit, 'action_var' . $unit)));
         $out .= '<br>';
     }
     $out .= '<span class="label">' . rcube::Q($this->plugin->gettext('setvarmodifiers')) . '</span>';
     foreach ($set_modifiers as $s_m) {
         $s_m_id = 'action_varmods' . $id . $s_m;
         $out .= '<br>' . html::tag('input', array('type' => 'checkbox', 'name' => '_action_varmods[' . $id . '][]', 'value' => $s_m, 'id' => $s_m_id, 'checked' => array_key_exists($s_m, (array) $action) && $action[$s_m])) . rcube::Q($this->plugin->gettext('var' . $s_m));
     }
     $out .= '</div>';
     // notify
     $notify_methods = (array) $this->rc->config->get('managesieve_notify_methods');
     $importance_options = $this->notify_importance_options;
     if (empty($notify_methods)) {
         $notify_methods = $this->notify_methods;
     }
     list($method, $target) = explode(':', $action['method'], 2);
     $method = strtolower($method);
     if ($method && !in_array($method, $notify_methods)) {
         $notify_methods[] = $method;
     }
     $select_method = new html_select(array('name' => "_action_notifymethod[{$id}]", 'id' => "_action_notifymethod{$id}", 'class' => $this->error_class($id, 'action', 'method', 'action_notifymethod')));
     foreach ($notify_methods as $m_n) {
         $select_method->add(rcube::Q($this->rc->text_exists('managesieve.notifymethod' . $m_n) ? $this->plugin->gettext('managesieve.notifymethod' . $m_n) : $m_n), $m_n);
     }
     $select_importance = new html_select(array('name' => "_action_notifyimportance[{$id}]", 'id' => "_action_notifyimportance{$id}", 'class' => $this->error_class($id, 'action', 'importance', 'action_notifyimportance')));
开发者ID:jimjag,项目名称:roundcubemail,代码行数:67,代码来源:rcube_sieve_engine.php

示例13: check_permflag

 /**
  * Checks the PERMANENTFLAGS capability of the current mailbox
  * and returns true if the given flag is supported by the IMAP server
  *
  * @param   string  $flag Permanentflag name
  * @return  boolean True if this flag is supported
  * @access  public
  */
 function check_permflag($flag)
 {
     $flag = strtoupper($flag);
     $imap_flag = $this->conn->flags[$flag];
     return in_array_nocase($imap_flag, $this->conn->data['PERMANENTFLAGS']);
 }
开发者ID:shishenkov,项目名称:zpanel,代码行数:14,代码来源:rcube_imap.php

示例14: reducedOptions

/**
* REWMOD 01/31/2013 Eric B *456848651351*  Reduces comma seperated options into array of single options 
* useful for making select lists from fields were most rows have multiple options
* Can provide DB column to be pulled, or array of items to be reduced
* 
* @global $idx, $db_idx;
* @param {String} (conditional) $field column name to pull options from
* @param {String} (optional) $extra extra where statement for pulling options
* @param {String} (optional) $filter regex to match values. any non matches are filtered out
* @param {String} (optional) $delimiter string delimiter for options, predefined as ", "
* @param {Array}  (conditional) $options existing array of options to be limited
* 
* @return {Array|Bool} Array of options on success, False on failure
* 
*/
function reducedOptions($field = null, $extra = null, $filter = null, $delimiter = ', ', $options = array())
{
    //trying to get away from globals since 4.3
    if (class_exists('Util_IDX')) {
        $idx = Util_IDX::getIdx();
        $db_idx = Util_IDX::getDatabase();
    } else {
        global $idx, $db_idx;
    }
    if (empty($options) && !empty($field)) {
        $query = "SELECT DISTINCT `" . $idx->field($field) . "` FROM `" . $idx->getTable() . "`" . (!empty($extra) ? ' WHERE ' . $extra : '') . " ORDER BY `" . $idx->field($field) . "` DESC LIMIT 20;";
        if ($result = $db_idx->query($query)) {
            while ($option = $db_idx->fetchArray($result)) {
                $options[] = $option[$field];
            }
        } else {
            return false;
        }
    }
    if (!empty($options)) {
        $post = array();
        $confirmed = array();
        foreach ($options as $val) {
            $pre = explode($delimiter, $val);
            //confirm and add to array
            foreach ($pre as $opt) {
                $opt = preg_replace('/(^\\s+)|(\\s{2,})|(\\s+$)|(\\n)|(\\r)/', ' ', $opt);
                //trim and remove exessive spacing
                if (!in_array_nocase($opt, $confirmed) && !empty($opt)) {
                    if (!empty($filter)) {
                        if (preg_match($filter, $opt)) {
                            $confirmed[] = $opt;
                        }
                    } else {
                        $confirmed[] = $opt;
                    }
                }
            }
        }
        //sort them
        if (!empty($confirmed)) {
            asort($confirmed);
            foreach ($confirmed as $opt) {
                $post[] = array('value' => $opt, 'title' => ucwords(strtolower($opt)));
            }
        }
        return $post;
    } else {
        return false;
    }
}
开发者ID:REWAdrianGalbraith,项目名称:erics-idx-collab-preston-guyton,代码行数:66,代码来源:universal.php

示例15: newImageName

         $messages .= "Sorry but this image size is " . $imageurlsize_mb . " MB which is bigger than the max allowed file size of " . $max_file_size_mb . " MB.";
         $err = "1";
     }
 }
 // save the file, if no error messages
 if ($err == "0") {
     // SAVE THE PICTURE
     $newFileName = newImageName($thefile);
     $FileName .= "|" . newImageName($thefile);
     $FileFile .= "|" . $server_dir . $newFileName;
     $newFile = $server_dir . $newFileName;
     $newFileUrl = $url . $newFileName;
     $FileUrl .= "|" . $url . $newFileName;
     $newFileUrlLink = $server_save_directory . $newFileName;
     $FileUrlLink .= "|" . $newFileName;
     if (in_array_nocase($file_ext, $valid_file_ext)) {
         $lx = 3;
         if ($file_ext == "jpeg") {
             $lx = 4;
         }
         $tnFileName = substr($newFileName, 0, strlen($newFileName) - $lx) . "jpg";
         $tnFileName = str_replace('.', '_tn.', $tnFileName);
         $tnFile = $server_dir . $tnFileName;
         $FiletnUrl .= "|" . $url . $tnFileName;
         $tnFileUrl = $url . $tnFileName;
     } else {
         $tnFileName = "";
         $tnFile = "";
         $tnFileUrl = "";
     }
     $newID = "";
开发者ID:oostrumoo,项目名称:testproject,代码行数:31,代码来源:uploaderurl.php


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