本文整理汇总了PHP中Preference::has_access方法的典型用法代码示例。如果您正苦于以下问题:PHP Preference::has_access方法的具体用法?PHP Preference::has_access怎么用?PHP Preference::has_access使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Preference
的用法示例。
在下文中一共展示了Preference::has_access方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create_preference_input
/**
* create_preference_input
* takes the key and then creates the correct type of input for updating it
*/
function create_preference_input($name, $value)
{
if (!Preference::has_access($name)) {
if ($value == '1') {
echo "Enabled";
} elseif ($value == '0') {
echo "Disabled";
} else {
if (preg_match('/_pass$/', $name) || preg_match('/_api_key$/', $name)) {
echo "******";
} else {
echo $value;
}
}
return;
}
// if we don't have access to it
switch ($name) {
case 'display_menu':
case 'download':
case 'quarantine':
case 'upload':
case 'access_list':
case 'lock_songs':
case 'xml_rpc':
case 'force_http_play':
case 'no_symlinks':
case 'use_auth':
case 'access_control':
case 'allow_stream_playback':
case 'allow_democratic_playback':
case 'allow_localplay_playback':
case 'demo_mode':
case 'condPL':
case 'rio_track_stats':
case 'rio_global_stats':
case 'direct_link':
case 'ajax_load':
case 'now_playing_per_user':
case 'show_played_times':
case 'song_page_title':
case 'subsonic_backend':
case 'plex_backend':
case 'webplayer_flash':
case 'webplayer_html5':
case 'allow_personal_info_now':
case 'allow_personal_info_recent':
case 'allow_personal_info_time':
case 'allow_personal_info_agent':
case 'ui_fixed':
case 'autoupdate':
case 'webplayer_confirmclose':
case 'webplayer_pausetabs':
case 'stream_beautiful_url':
case 'share':
case 'share_social':
case 'broadcast_by_default':
case 'album_group':
case 'topmenu':
case 'demo_clear_sessions':
case 'show_donate':
case 'allow_upload':
case 'upload_subdir':
case 'upload_user_artist':
case 'upload_allow_edit':
case 'daap_backend':
case 'upnp_backend':
case 'album_release_type':
case 'home_moment_albums':
case 'home_moment_videos':
case 'home_recently_played':
case 'home_now_playing':
case 'browser_notify':
case 'allow_video':
case 'geolocation':
case 'webplayer_aurora':
case 'upload_allow_remove':
case 'webdav_backend':
case 'notify_email':
$is_true = '';
$is_false = '';
if ($value == '1') {
$is_true = "selected=\"selected\"";
} else {
$is_false = "selected=\"selected\"";
}
echo "<select name=\"{$name}\">\n";
echo "\t<option value=\"1\" {$is_true}>" . T_("Enable") . "</option>\n";
echo "\t<option value=\"0\" {$is_false}>" . T_("Disable") . "</option>\n";
echo "</select>\n";
break;
case 'upload_catalog':
show_catalog_select('upload_catalog', $value, '', true);
break;
case 'play_type':
$is_localplay = '';
//.........这里部分代码省略.........
示例2:
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
?>
<div id="play_type_switch">
<?php
$name = "is_" . AmpConfig::get('play_type');
${$name} = 'selected="selected" ';
if (Preference::has_access('play_type')) {
?>
<form method="post" id="play_type_form" action="javascript.void(0);">
<select id="play_type_select" name="type">
<?php
if (AmpConfig::get('allow_stream_playback')) {
?>
<option value="stream" <?php
if (isset($is_stream)) {
echo $is_stream;
}
?>
><?php
echo T_('Stream');
?>
</option>
示例3: create_preference_input
/**
* create_preference_input
* takes the key and then creates the correct type of input for updating it
*/
function create_preference_input($name, $value)
{
if (!Preference::has_access($name)) {
if ($value == '1') {
echo "Enabled";
} elseif ($value == '0') {
echo "Disabled";
} else {
if (preg_match('/_pass$/', $name) || preg_match('/_api_key$/', $name)) {
echo "******";
} else {
echo $value;
}
}
return;
}
// if we don't have access to it
switch ($name) {
case 'display_menu':
case 'download':
case 'quarantine':
case 'upload':
case 'access_list':
case 'lock_songs':
case 'xml_rpc':
case 'force_http_play':
case 'no_symlinks':
case 'use_auth':
case 'access_control':
case 'allow_stream_playback':
case 'allow_democratic_playback':
case 'allow_localplay_playback':
case 'demo_mode':
case 'condPL':
case 'rio_track_stats':
case 'rio_global_stats':
case 'direct_link':
case 'ajax_load':
case 'now_playing_per_user':
case 'show_played_times':
case 'song_page_title':
case 'subsonic_backend':
case 'plex_backend':
case 'webplayer_flash':
case 'webplayer_html5':
case 'allow_personal_info_now':
case 'allow_personal_info_recent':
case 'allow_personal_info_time':
case 'allow_personal_info_agent':
case 'ui_fixed':
case 'autoupdate':
case 'webplayer_confirmclose':
case 'webplayer_pausetabs':
case 'stream_beautiful_url':
case 'share':
case 'share_social':
case 'broadcast_by_default':
case 'album_group':
case 'topmenu':
case 'demo_clear_sessions':
case 'show_donate':
case 'allow_upload':
case 'upload_subdir':
case 'upload_user_artist':
case 'upload_allow_edit':
case 'daap_backend':
case 'upnp_backend':
case 'album_release_type':
case 'home_moment_albums':
case 'home_moment_videos':
case 'home_recently_played':
case 'home_now_playing':
case 'browser_notify':
case 'allow_video':
case 'geolocation':
case 'webplayer_aurora':
case 'upload_allow_remove':
case 'webdav_backend':
case 'notify_email':
$is_true = '';
$is_false = '';
if ($value == '1') {
$is_true = "selected=\"selected\"";
} else {
$is_false = "selected=\"selected\"";
}
echo "<select name=\"{$name}\">\n";
echo "\t<option value=\"1\" {$is_true}>" . T_("Enable") . "</option>\n";
echo "\t<option value=\"0\" {$is_false}>" . T_("Disable") . "</option>\n";
echo "</select>\n";
break;
case 'upload_catalog':
show_catalog_select('upload_catalog', $value, '', true);
break;
case 'play_type':
$is_localplay = '';
//.........这里部分代码省略.........