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


PHP Horde_Themes::soundList方法代码示例

本文整理汇总了PHP中Horde_Themes::soundList方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde_Themes::soundList方法的具体用法?PHP Horde_Themes::soundList怎么用?PHP Horde_Themes::soundList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Horde_Themes的用法示例。


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

示例1: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $prefs;
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
     $view->addHelper('FormTag');
     $view->addHelper('Tag');
     $view->addHelper('Text');
     $newmail_audio = $view->newmail_audio = $prefs->getValue('newmail_audio');
     $sounds = array();
     foreach (Horde_Themes::soundList() as $key => $val) {
         $sounds[] = array('c' => $newmail_audio == $key, 'l' => $key, 's' => $val->uri, 'v' => $key);
     }
     $view->sounds = $sounds;
     return $view->render('newmailaudio');
 }
开发者ID:horde,项目名称:horde,代码行数:17,代码来源:NewmailSound.php

示例2: init

 function init()
 {
     $this->_sounds = array_keys(Horde_Themes::soundList());
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:4,代码来源:Type.php

示例3: switch

        $taskAlarmParams .= ' <label for="kronolithTaskAlarmParam' . $name . '">' . $param['desc'] . '</label> ';
        $taskNameAtt = 'name="task[methods][' . $method . '][' . $name . ']"';
        $taskAtt = 'id="kronolithTaskAlarmParam' . $name . '" ' . $taskNameAtt;
        switch ($param['type']) {
            case 'text':
                $eventAlarmParams .= '<input type="text" ' . $eventAtt . ' />';
                $taskAlarmParams .= '<input type="text" ' . $taskAtt . ' />';
                break;
            case 'boolean':
                $eventAlarmParams .= '<input type="checkbox" ' . $eventAtt . ' />';
                $taskAlarmParams .= '<input type="checkbox" ' . $taskAtt . ' />';
                break;
            case 'sound':
                $eventAlarmParams .= '<ul class="sound-list"><li><input type="radio" ' . $eventAtt . ' value="" checked="checked" /> ' . _("No Sound") . '</li>';
                $taskAlarmParams .= '<ul class="sound-list"><li><input type="radio" ' . $taskAtt . ' value="" checked="checked" /> ' . _("No Sound") . '</li>';
                foreach (Horde_Themes::soundList() as $key => $val) {
                    $sound = htmlspecialchars($key);
                    $value = sprintf('<li><input type="radio" id="%s%s" %s value="%s" /> <embed autostart="false" src="%s" /> %s</li>', '%s', $name . str_replace('.wav', '', $sound), '%s', $sound, htmlspecialchars($val->uri), $sound);
                    $eventAlarmParams .= sprintf($value, 'kronolithEventAlarmParam', $eventNameAtt);
                    $taskAlarmParams .= sprintf($value, 'kronolithTaskAlarmParam', $taskNameAtt);
                }
                $eventAlarmParams .= '</ul>';
                $taskAlarmParams .= '</ul>';
                break;
        }
        $eventAlarmParams .= '<br />';
        $taskAlarmParams .= '<br />';
    }
    $eventAlarmParams = substr($eventAlarmParams, 0, -6) . '</div>';
    $taskAlarmParams = substr($taskAlarmParams, 0, -6) . '</div>';
}
开发者ID:raz0rsdge,项目名称:horde,代码行数:31,代码来源:index.php

示例4: alarm

 /**
  * Create code needed for alarm selection.
  *
  * @param array $data  Data items:
  * - 'helplink': (string) [OPTIONAL] Help link.
  * - 'label': (string) Label.
  * - 'pref': (string) Preference name.
  * - 'value': (array) [OPTIONAL] Preference value.
  *
  * @return string  HTML UI code.
  */
 public static function alarm($data)
 {
     $pref = $data['pref'];
     $GLOBALS['injector']->getInstance('Horde_PageOutput')->addInlineJsVars(array('HordeAlarmPrefs.pref' => $pref));
     $alarm_pref = isset($data['value']) ? $data['value'] : unserialize($GLOBALS['prefs']->getValue($pref));
     $selected = array_keys($alarm_pref);
     $t = $GLOBALS['injector']->createInstance('Horde_Template');
     $t->setOption('gettext', true);
     $param_list = $select_list = array();
     foreach ($GLOBALS['injector']->getInstance('Horde_Alarm')->handlers() as $method => $handler) {
         $select_list[] = array('l' => $handler->getDescription(), 's' => in_array($method, $selected), 'v' => $method);
         $tmp = array('method' => $method, 'param' => array());
         foreach ($handler->getParameters() as $name => $param) {
             switch ($param['type']) {
                 case 'text':
                     $tmp['param'][] = array('label' => Horde::label($pref . '_' . $name, $param['desc']), 'name' => $pref . '_' . $name, 'text' => true, 'value' => empty($alarm_pref[$method][$name]) ? '' : htmlspecialchars($alarm_pref[$method][$name]));
                     break;
                 case 'bool':
                     $tmp['param'][] = array('bool' => true, 'checked' => !empty($alarm_pref[$method][$name]), 'label' => Horde::label($pref . '_' . $name, $param['desc']), 'name' => $pref . '_' . $name);
                     break;
                 case 'sound':
                     $current_sound = empty($alarm_pref[$method][$name]) ? '' : $alarm_pref[$method][$name];
                     $sounds = array();
                     foreach (Horde_Themes::soundList() as $key => $val) {
                         $sounds[] = array('c' => $current_sound == $key, 'uri' => htmlspecialchars($val->uri), 'val' => htmlspecialchars($key));
                     }
                     $t->set('sounds', $sounds);
                     $tmp['param'][] = array('sound' => true, 'checked' => !$current_sound, 'name' => $pref . '_' . $name);
                     break;
             }
         }
         $param_list[] = $tmp;
     }
     $t->set('desc', Horde::label($pref, $data['label']));
     if (!empty($data['helplink'])) {
         $t->set('helplink', $data['helplink']);
     }
     $t->set('pref', htmlspecialchars($pref));
     $t->set('param_list', $param_list);
     $t->set('select_list', $select_list);
     return $t->fetch($GLOBALS['registry']->get('templates', 'horde') . '/prefs/alarm.html');
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:53,代码来源:Widgets.php


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