コード例 #1
0
ファイル: functions.inc.php プロジェクト: umjinsun12/dngshin
 function generateConf()
 {
     global $amp_conf;
     global $version;
     //asterisk version
     $path_to_moh_dir = $amp_conf['ASTVARLIBDIR'] . '/' . $amp_conf['MOHDIR'];
     $output = "";
     $File_Write = "";
     $tresults = music_list();
     if (isset($tresults)) {
         if (version_compare($version, "1.6.0", "ge")) {
             $random = "sort=random\n";
             $alpha = "sort=alpha\n";
         } else {
             $random = "random=yes\n";
             $alpha = "";
         }
         foreach ($tresults as $tresult) {
             // hack - but his is all a hack until redone, in functions, etc.
             // this puts a none category to allow no music to be chosen
             //
             if ($tresult == "none") {
                 $dir = $path_to_moh_dir . "/.nomusic_reserved";
                 if (!is_dir($dir)) {
                     music_makemusiccategory($dir);
                 }
                 touch($dir . "/silence.wav");
             } elseif ($tresult != "default") {
                 $dir = $path_to_moh_dir . "/{$tresult}/";
             } else {
                 $dir = $path_to_moh_dir . '/';
             }
             if (file_exists("{$dir}.custom")) {
                 $application = file_get_contents("{$dir}.custom");
                 $File_Write .= "[{$tresult}]\nmode=custom\napplication={$application}\n";
             } else {
                 if (file_exists("{$dir}.random")) {
                     $File_Write .= "[{$tresult}]\nmode=files\ndirectory={$dir}\n{$random}";
                 } else {
                     $File_Write .= "[{$tresult}]\nmode=files\ndirectory={$dir}\n{$alpha}";
                 }
             }
         }
     }
     return $File_Write;
 }
コード例 #2
0
ファイル: page.conferences.php プロジェクト: hardikk/HNH
        ?>
        <tr>
                <td><a href="#" class="info"><?php 
        echo _("Music on Hold Class:");
        ?>
<span><?php 
        echo _("Music (or Commercial) played to the caller while they wait in line for the conference to start. Choose \"inherit\" if you want the MoH class to be what is currently selected, such as by the inbound route.<br><br>  This music is defined in the \"Music on Hold\" to the left.");
        ?>
</span></a></td>
                <td>
                        <select name="music" tabindex="<?php 
        echo ++$tabindex;
        ?>
">
                        <?php 
        $tresults = music_list();
        array_unshift($tresults, 'inherit');
        $default = isset($music) ? $music : 'inherit';
        if (isset($tresults)) {
            foreach ($tresults as $tresult) {
                $searchvalue = "{$tresult}";
                $tresult == 'inherit' ? $ttext = _("inherit") : ($ttext = $tresult);
                $tresult == 'default' ? $ttext = _("default") : ($ttext = $tresult);
                echo '<option value="' . $tresult . '" ' . ($searchvalue == $default ? 'SELECTED' : '') . '>' . $ttext;
            }
        }
        ?>
                        </select>
                </td>
        </tr>
<?php 
コード例 #3
0
ファイル: page.music.php プロジェクト: hardikk/HNH
function createmusicconf()
{
    global $amp_conf;
    global $path_to_moh_dir;
    $File_Write = "";
    $tresults = music_list();
    if (isset($tresults)) {
        foreach ($tresults as $tresult) {
            // hack - but his is all a hack until redone, in functions, etc.
            // this puts a none category to allow no music to be chosen
            //
            if ($tresult == "none") {
                $dir = $path_to_moh_dir . "/.nomusic_reserved";
                if (!is_dir($dir)) {
                    makemusiccategory($dir);
                }
                touch($dir . "/silence.wav");
            } elseif ($tresult != "default") {
                $dir = $path_to_moh_dir . "/{$tresult}/";
            } else {
                $dir = $path_to_moh_dir . '/';
            }
            if (file_exists("{$dir}.custom")) {
                $application = file_get_contents("{$dir}.custom");
                $File_Write .= "[{$tresult}]\nmode=custom\napplication={$application}\n";
            } else {
                if (file_exists("{$dir}.random")) {
                    $File_Write .= "[{$tresult}]\nmode=files\ndirectory={$dir}\nrandom=yes\n";
                } else {
                    $File_Write .= "[{$tresult}]\nmode=files\ndirectory={$dir}\n";
                }
            }
        }
    }
    $handle = fopen($amp_conf['ASTETCDIR'] . "/musiconhold_additional.conf", "w");
    if (fwrite($handle, $File_Write) === FALSE) {
        echo _("Cannot write to file") . " ({$tmpfname})";
        exit;
    }
    fclose($handle);
}
コード例 #4
0
ファイル: form.php プロジェクト: lidl/findmefollow
if (function_exists('music_list')) {
    $ringhtml = '
	<!--Play Music On Hold-->
	<div class="element-container">
		<div class="row">
			<div class="col-md-12">
				<div class="row">
					<div class="form-group">
						<div class="col-md-3">
							<label class="control-label" for="ringing">' . _("Play Music On Hold") . '</label>
							<i class="fa fa-question-circle fpbx-help-icon" data-for="ringing"></i>
						</div>
						<div class="col-md-9">
							<select name="ringing" id="ringing" class="form-control">';
    $cur = isset($ringing) ? $ringing : 'Ring';
    $tresults = \music_list();
    $ringhtml .= '<option value="Ring">' . _("Ring") . '</option>';
    if (isset($tresults[0])) {
        foreach ($tresults as $tresult) {
            $tresult == 'none' ? $ttext = _("none") : ($ttext = $tresult);
            $tresult == 'default' ? $ttext = _("default") : ($ttext = $tresult);
            $ringhtml .= '<option value="' . $tresult . '"' . ($tresult == $cur ? ' SELECTED' : '') . '>' . _($ttext) . "</option>\n";
        }
    }
    $ringhtml .= '			</select>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
コード例 #5
0
ファイル: web-sources.php プロジェクト: vertino/pez
						<div id="bookmarks" class="drop">
							<h3>Bookmarks Module</h3>
							<?php 
echo bookmark_list(false, true);
?>
						</div>
						<div id="photos" class="drop">
							<h3>Photos Module</h3>
							<?php 
echo photo_list(false, true);
?>
						</div>
						<div id="music" class="drop">
							<h3>Music Module</h3>
							<?php 
echo music_list(false, true);
?>
						</div>
						<div id="location" class="drop">
							<h3>Location Module</h3>
							<?php 
echo location_list(false, true);
?>
						</div>
					</div>
					
					<div>
						<input type="hidden" name="form_name" id="id_form_name" value="modules_form" />
						<input type="submit" name="save" id="id_save_3" value="Save" />
					</div>
					
コード例 #6
0
ファイル: install.php プロジェクト: umjinsun12/dngshin
<?php

if (!defined('FREEPBX_IS_AUTH')) {
    die('No direct script access allowed');
}
global $asterisk_conf;
global $amp_conf;
require_once dirname(__FILE__) . '/functions.inc.php';
// In case there is an old version as part of the upgrade process, we will derive the current path
//
$moh_subdir = isset($amp_conf['MOHDIR']) ? trim(trim($amp_conf['MOHDIR']), '/') : 'mohmp3';
$path_to_moh_dir = $amp_conf['ASTVARLIBDIR'] . "/{$moh_subdir}";
$File_Write = "";
$tresults = music_list($path_to_moh_dir);
if (isset($tresults)) {
    foreach ($tresults as $tresult) {
        if ($tresult == "default") {
            $dir = $path_to_moh_dir;
        } elseif ($tresult == "none") {
            $dir = $path_to_moh_dir . "/.nomusic_reserved";
            if (!is_dir($dir)) {
                mkdir("{$dir}", 0755, true);
            }
            touch($dir . "/silence.wav");
        } else {
            $dir = $path_to_moh_dir . "/{$tresult}/";
        }
        if (file_exists("{$dir}.random")) {
            $File_Write .= "[{$tresult}]\nmode=files\ndirectory={$dir}\nrandom=yes\n";
        } else {
            $File_Write .= "[{$tresult}]\nmode=files\ndirectory={$dir}\n";
コード例 #7
0
ファイル: Music.class.php プロジェクト: umjinsun12/dngshin
 public function getAllMusic()
 {
     return music_list();
 }
コード例 #8
0
ファイル: functions.inc.php プロジェクト: lidl/findmefollow
function findmefollow_users_configpageload($pagename)
{
    global $currentcomponent;
    global $amp_conf;
    global $extdisplay;
    $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
    $extdisplay = isset($_REQUEST['extdisplay']) ? $_REQUEST['extdisplay'] : null;
    $extension = isset($_REQUEST['extension']) ? $_REQUEST['extension'] : null;
    $tech_hardware = isset($_REQUEST['tech_hardware']) ? $_REQUEST['tech_hardware'] : null;
    $fmfm = isset($extdisplay) && trim($extdisplay) != '' ? findmefollow_get($extdisplay, 1) : array();
    if (empty($fmfm) && (!isset($extdisplay) || trim($extdisplay) == '')) {
        $fmfm = array("ddial" => $amp_conf['FOLLOWME_DISABLED'] && !$amp_conf['FOLLOWME_AUTO_CREATE'] ? "CHECKED" : "", "strategy" => $amp_conf['FOLLOWME_RG_STRATEGY'], "grptime" => $amp_conf['FOLLOWME_TIME'], "pre_ring" => $amp_conf['FOLLOWME_PRERING']);
    } elseif (empty($fmfm) && isset($extdisplay) && trim($extdisplay) != '') {
        $fmfm = array("ddial" => $amp_conf['FOLLOWME_DISABLED'] && !$amp_conf['FOLLOWME_AUTO_CREATE'] ? "CHECKED" : "", 'grplist' => $extdisplay, 'postdest' => "ext-local," . $extdisplay . ",dest", "strategy" => $amp_conf['FOLLOWME_RG_STRATEGY'], "grptime" => $amp_conf['FOLLOWME_TIME'], "pre_ring" => $amp_conf['FOLLOWME_PRERING']);
    }
    $moh = music_list();
    $recordings = recordings_list();
    $recordingslist = array();
    $recordingslist[] = array("value" => "", "text" => _("None"));
    if (!empty($recordings)) {
        foreach ($recordings as $recording) {
            $recordingslist[] = array("value" => $recording['id'], "text" => $recording['displayname']);
        }
    }
    $disabled = $fmfm['ddial'] == "CHECKED";
    $category = "findmefollow";
    $currentcomponent->addTabTranslation($category, _("Find Me/Follow Me"));
    findmefollow_draw_general($fmfm, $currentcomponent, $category, $disabled, $recordingslist, $moh);
    findmefollow_draw_confirm($fmfm, $currentcomponent, $category, $disabled, $recordingslist, $moh);
    findmefollow_draw_cid($fmfm, $currentcomponent, $category, $disabled, $recordingslist, $moh);
    findmefollow_draw_destinations($fmfm, $currentcomponent, $category, $disabled, $recordingslist, $moh);
}
コード例 #9
0
ファイル: diamond_music.php プロジェクト: noikiy/zays
        salert($ps, 'index.php?action=diamond_music&h=list');
        //echo "<script>window.history.go(-1);</script>";
    }
    require adminTemplate('diamond_music_add');
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string') == '' ? 'list' : MooGetGPC('h', 'string');
//note 动作列表
$hlist = array('list', 'del', 'add');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
    salert('您要打开的页面不存在');
    echo "<script>window.history.go(-1);</script>";
    exit;
}
define('MP3_DIR', '../data/mp3/');
//note 判断是否有权限
if (!checkGroup('site_diamond', $h)) {
    //salert('您没有修改此操作的权限');
}
switch ($h) {
    case 'list':
        music_list();
        break;
    case 'del':
        music_del();
        break;
    case 'add':
        music_add();
        break;
}