本文整理汇总了PHP中L::__方法的典型用法代码示例。如果您正苦于以下问题:PHP L::__方法的具体用法?PHP L::__怎么用?PHP L::__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类L
的用法示例。
在下文中一共展示了L::__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: iJson
public function iJson($val, $len = 64)
{
$res = false;
if ('string' != gettype($val)) {
$this->session->addError(L::__('Incoming JSON string is no string.'));
return false;
}
$val = html_entity_decode($val);
$val = substr($val, 0, $len);
if ('' != $val && false != $val) {
$res = $val;
}
return $res;
}
示例2: placeVote
public function placeVote($vote)
{
// time-based-lock of 60 seconds
// between two vote attemtps
$stamp = date('U');
$lastVoteStamp = $this->session->get('votestamp');
if (false != $lastVoteStamp) {
if ($lastVoteStamp + 60 > $stamp) {
$this->session->setError(L::__('Please be patient'));
return false;
}
}
$res = $this->webDBUtils->placeVote($vote);
if (false != $res) {
$this->session->set('votestamp', $stamp);
}
return $res;
}
示例3: startBroadcast
public function startBroadcast()
{
$this->stopBroadCast();
$configPath = '';
$res = $this->user->getStream();
if (false == $res) {
$this->session->addError(L::__('No stream.'));
return false;
}
$stream = $res[0];
$configPath = $res[0]['config_path'];
$com = '' . Settings::streamBinPath . ' -c ' . escapeshellarg($configPath) . ' > /dev/null &echo $!';
$this->log->addMessage('Exec: ' . $com);
$ary = array();
$res = exec($com, $ary);
$pid = $ary[0];
// updates the pid
$stream['pid'] = $pid;
$res = $this->user->updateStream($stream);
return $pid;
}
示例4: registerStream
public function registerStream($stream)
{
// --> mock
$uid = $stream['uid'];
if (false != $this->streamByUserId($uid)) {
$this->session->addError(L::__('User has a registered stream.'));
return false;
}
// <<-- mock
$sql = 'call rrradio.stream_by_user_id(0)';
$res = $this->execGet($sql);
if (false == $res) {
$this->session->addError(L::__('There is no streams.'));
return false;
}
$sql = 'call rrradio.update_stream(
"' . $res[0]['id'] . '",
"' . $stream['uid'] . '",
"' . $stream['pid'] . '",
"' . $stream['config_path'] . '",
"' . $stream['playlist_path'] . '"
)';
$res = $this->execGet($sql);
return $res;
}
示例5:
$diffPermissions .= '<a class="act" href="javascript:Client.activatePermission(\'' . $permission . '\');">' . $l_activate . '</a>';
$diffPermissions .= ' ';
$diffPermissions .= '<a class="deact" href="javascript:Client.deactivatePermission(\'' . $permission . '\');">' . $l_deactivate . '</a>';
$diffPermissions .= '</div>';
$diffPermissions .= '</div>';
$diffPermissions .= '</li>';
}
$l_description = L::__('Description');
$l_name = L::__('Name');
$l_edit = L::__('Edit Userroles');
require_once 'chunks/admin.headline.php';
$name = L::__($role['name']);
$description = L::__($role['description']);
$l_save = L::__('Save Role');
$l_nameInput = L::__('Name');
$l_descInput = L::__('Description');
print <<<EOD
<div id="formhead">
\t<span class="">{$l_nameInput}</span>
\t<div class="alert alert-success">
\t\t<input type="text" class="form-control" placeholder="{$l_name}" value="{$name}" id="name">
\t</div>
\t<span class="">{$l_descInput}</span>
\t<div class="alert alert-success">
\t\t<input type="text" class="form-control" placeholder="{$l_description}" value="{$description}" id="description">
\t</div>
</div>
EOD;
print <<<EOD
示例6: loadEmbedSettings
public function loadEmbedSettings()
{
$path = Settings::embedSettingsPath;
$res = @file_get_contents($path);
if (false == $res) {
$this->session->addError(L::__('File not found: ') . $path);
$this->log->addMessage('File not found: ' . $path);
}
if (false == $res) {
$res = new EmbedSettings();
$this->settings = $res;
return $res;
}
$res = json_decode($res);
if (false == $res) {
$this->session->addError(L::__('Settings file is no JSON.'));
$this->log->addMessage('Settings file is no JSON.');
return false;
}
$this->settings = $res;
return $res;
}
示例7: isset
require_once 'chunks/admin.menu.php';
?>
</div>
<div id="right">
<?php
$l_save = L::__('Save Tenant');
$l_edit = L::__('Edit Tenant');
$l_tenantSaved = L::__('Tenant saved.');
require_once 'chunks/admin.headline.php';
$tid = isset($tid) ? $tid : '';
$tenant = isset($tenant) ? $tenant : [];
$buf = '';
$ids = [];
foreach ($tenant as $t) {
foreach ($t as $key => $value) {
$plchldr = L::__($key);
switch ($key) {
case 'id':
break;
default:
$buf .= '<input type="text" class="form-control" placeholder="' . $plchldr . '" name="' . $key . '" id="' . $key . '" value="' . $value . '">';
break;
}
$ids[] = $key;
}
}
$ids = json_encode($ids, JSON_PRETTY_PRINT);
print <<<EOD
<script type="text/javascript" language="javascript">'use strict';
var Client = Client == null ? {} : Client;
示例8:
<?php
$l_register = L::__('Broadcast Register');
require_once 'chunks/html.page.header.php';
require_once 'chunks/html.body.header.php';
require_once 'chunks/appwerk.logo.php';
require_once 'chunks/register.php';
require_once 'chunks/html.body.footer.php';
require_once 'chunks/html.page.footer.php';
示例9:
\t<div class="btn-group">
\t\t<button type="button" class="btn btn-warning">{$l_channels}</button>
\t\t<button type="button" class="btn btn-warning dropdown-toggle" data-toggle="dropdown">
\t\t\t<span class="caret"></span>
\t\t</button>
\t\t<ul class="dropdown-menu" role="menu">
\t\t \t{$buf}
\t\t</ul>
\t</div>
</div>
EOD;
print <<<EOD
<div id="config"></div>
EOD;
$l_json = L::__('Screenlayout JSON');
print <<<EOD
<div id="jsonhead" class=""><b>{$l_json}</b></div>
<div id="json">
\t<div class="">
\t\t<textarea id="json-input" class="json"></textarea>
\t\t<button type="submit" class="btn btn-default" onclick="javascript:Client.saveLayoutJSON();">{$l_save}</button>
\t</div>
</div>
EOD;
?>
</div><?php
require_once 'chunks/html.body.footer.php';
require_once 'chunks/html.page.footer.php';
示例10:
<?php
require_once 'chunks/html.page.header.php';
require_once 'chunks/html.body.header.php';
require_once 'chunks/appwerk.logo.php';
// require_once('chunks/menu.php');
require_once 'chunks/errors.php';
$l_public = L::__('Public');
print <<<EOD
<div class="jumbotron">
<h1>{$l_public}</h1>
<img src="{$base}/assets/VU_analog.gif"/>
</div>
EOD;
require_once 'chunks/html.body.footer.php';
require_once 'chunks/html.page.footer.php';
示例11: deleteRole
public function deleteRole($rid)
{
$role = $this->getRoleById($rid);
if (RoleUtils::ADMIN === $role['name'] || RoleUtils::TENANT === $role['name'] || RoleUtils::GUEST === $role['name']) {
$this->session->addError(L::__('Will not delete this group.'));
return false;
}
$res = $this->webDBUtils->deleteUserRole($rid);
return $res;
}
示例12: writeMP3
public function writeMP3()
{
$res = false;
if (false == isset($_FILES)) {
$this->session->setError(L::__('No upload.'));
return false;
}
foreach ($_FILES as $file) {
$src = $file['tmp_name'];
if (false == $this->isMP3($src)) {
$this->session->setError(L::__('Not an MP3 file.'));
return false;
}
$nme = $file['name'];
$nme = Utils::getInstance()->iStr($nme, 128);
$nme = Utils::getInstance()->strToFilename($nme);
$path = $nme;
$dest1 = Settings::storage . $this->user->getBucket() . '/' . $nme;
$dest2 = Settings::storage . $this->user->getBucket() . '/marked/' . $nme;
$this->log->addMessage('Moving file from "' . $src . '" to "' . $dest1 . '"');
$res = @move_uploaded_file($src, $dest1);
if (false == $res) {
$this->session->setError(L::__('Could not move the file.'));
return false;
}
$res = @chmod($dest1, 0644);
if (false == $res) {
$this->session->setError(L::__('Could not chmod the file.'));
return false;
}
$this->log->addMessage('Copying file "' . $dest1 . '" to "' . $dest2 . '"');
$res = @copy($dest1, $dest2);
if (false == $res) {
$this->session->setError(L::__('Could not copy the file.'));
return false;
}
$res = @chmod($dest2, 0644);
if (false == $res) {
$this->session->setError(L::__('Could not chmod the file.'));
return false;
}
$song = array('name' => $nme, 'artist' => '', 'year' => '', 'duration' => '', 'album' => '', 'path' => $path, 'uid' => $this->user->getId(), 'rid' => $this->user->getRadioId());
$res = $this->webDBUtils->addSong($song);
}
return $res;
}
示例13:
<?php
require_once 'chunks/html.page.header.php';
require_once 'chunks/html.body.header.php';
require_once 'chunks/base.js.php';
?>
<!-- admin-add-user.php //-->
<div id="left"><?php
require_once 'chunks/admin.menu.php';
?>
</div>
<div id="right">
<?php
require_once 'chunks/appwerk.admin.logo.php';
require_once 'chunks/errors.php';
// require_once('chunks/welcome.user.php');
// require_once('chunks/message.php');
$l_edit = L::__('User');
require_once 'chunks/admin.headline.php';
print <<<EOD
<form action="{$base}/admin/add-user" method="post">
EOD;
require_once 'chunks/register.php';
print <<<EOD
</form>
EOD;
?>
</div><?php
require_once 'chunks/html.body.footer.php';
require_once 'chunks/html.page.footer.php';
示例14: isset
<?php
$l_login = L::__('Login');
$mail = isset($mail) ? $mail : '';
print <<<EOD
<div class="input-group input-group-lg">
\t<span class="input-group-addon"></span>
\t<input type="text" class="form-control" placeholder="[ user@email.com ]" name="mail" value="{$mail}">
\t<input type="password" class="form-control" placeholder="[ **** ]" name="pass">
\t<br/>
\t<button type="submit" class="btn btn-default">{$l_login}</button>
</div>
EOD
;
示例15: MULTI
<?php
$wmUtils = WatermarkUtils::getInstance();
$type = $wmUtils->settings->type;
$mid = $wmUtils->settings->mid;
$midLen = $wmUtils->settings->midLen;
$multi = 'multi' == $type ? 'checked' : '';
$uni = 'uni' == $type ? 'checked' : '';
$l_save = L::__('Save Settings');
$l_writeMessage = L::__('Watermark all Files');
$l_uniMessageSel = L::__('Messages of type UNI');
$l_multiMessageSel = L::__('Messages of type MULTI (periodic)');
$l_messageAsString = L::__('Message as String (depr.)');
$l_messageAsID = L::__('MessageID');
$l_len = L::__('of length');
$l_message = L::__('Message');
print <<<EOD
<div id="messageinput">
\t<div class="input-group input-group-lg">
\t\t<span class="input-group-addon">{$l_messageAsID}<br>{$l_len}</span>
\t\t<input type="number" id="mid" class="form-control" value="{$mid}" placeholder="{$mid}">
\t\t<input type="number" id="midLen" class="form-control" value="{$midLen}" placeholder="{$midLen}">
\t</div>
\t<div class="radio">
\t\t<form id="types">
\t\t<label>
\t\t\t<input type="radio" name="type" id="uni" value="uni" {$uni}>
\t\t\t{$l_uniMessageSel}\t
\t\t</label>