本文整理汇总了PHP中Helper::translate方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::translate方法的具体用法?PHP Helper::translate怎么用?PHP Helper::translate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helper
的用法示例。
在下文中一共展示了Helper::translate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clean_map
public static function clean_map($properties)
{
$avoid = array('_', 'Converse+by+John+Varvatos');
foreach (get_object_vars($properties) as $prop => $val) {
if ($prop === 'brands') {
asort($properties->{$prop});
} else {
rsort($properties->{$prop});
}
foreach ($properties->{$prop} as $k => $v) {
if (in_array($v, $avoid)) {
unset($properties->{$prop}[$k]);
} else {
$properties->{$prop}[$k] = Helper::translate($properties->{$prop}[$k]);
// $properties->{$prop}[$k] = array('t' => $t, 'u' => $u);
// $properties->{$prop}[$k] = strtolower( str_replace(array('+', '-'), ' ', $properties->{$prop}[$k]));
}
}
}
return $properties;
}
示例2: onUnauthorizedAccess
protected function onUnauthorizedAccess()
{
/**
* Check if the unautorizedacces is a result of the user no longer being logged in.
* If so, redirect the user to the login page and after login return the user to the page they tried to open.
* If not, show the unautorizedacces message.
*/
if (Yii::app()->user->isGuest) {
Yii::app()->user->loginRequired();
} else {
$mod = $this->module !== null ? $this->module->id : "";
$access = $mod . ucfirst($this->id) . ucfirst($this->action->id);
$error["code"] = "403";
$error["title"] = Helper::translate('srbac', 'You are not authorized for this action');
$error["message"] = Helper::translate('srbac', 'Error while trying to access') . ' ' . $mod . "/" . $this->id . "/" . $this->action->id . ".";
//You may change the view for unauthorized access
if (Yii::app()->request->isAjaxRequest) {
$this->renderPartial(Yii::app()->getModule('srbac')->notAuthorizedView, array("error" => $error));
} else {
$this->render(Yii::app()->getModule('srbac')->notAuthorizedView, array("error" => $error));
}
return false;
}
}
示例3: array
echo SHtml::link($model->name, array('show', 'id' => $model->name));
?>
</td>
<td><?php
echo SHtml::encode(AuthItem::$TYPES[$model->type]);
?>
</td>
<td>
<?php
echo SHtml::link(Helper::translate('srbac', 'Update'), array('update', 'id' => $model->name));
?>
<?php
if ($model->name != Yii::app()->getModule('srbac')->superUser) {
?>
<?php
echo SHtml::linkButton(Helper::translate('srbac', 'Delete'), array('submit' => '', 'params' => array('command' => 'delete', 'id' => $model->name), 'confirm' => "Are you sure to delete #{$model->name}?"));
?>
<?php
}
?>
</td>
</tr>
<?php
}
?>
</table>
<br/>
<?php
$this->widget('CLinkPager', array('pages' => $pages));
?>
示例4: array
<?php
echo SHtml::ajaxLink(SHtml::image($this->module->getIconsPath() . '/delete.png', "Delete All Auth Items of controller " . $controller, array('border' => 0, 'title' => Helper::translate('srbac', 'Delete All Auth Items of controller') . ' ' . $controller)), array('scan', 'module' => $module, 'controller' => $controller, 'delete' => true), array('type' => 'POST', 'update' => '#controllerActions', 'beforeSend' => 'function(){
$("#controllerActions").addClass("srbacLoading");
}', 'complete' => 'function(){
$("#controllerActions").removeClass("srbacLoading");
}'), array('name' => 'buttonDelete_' . $n));
?>
</td>
</tr>
<?php
}
?>
</table>
</td>
<td width="60%" style="vertical-align: top">
<table class="srbacDataGrid" width="50%" style="float:left">
<tr>
<th width="70%"><?php
echo Helper::translate('srbac', 'Auth items');
?>
</th>
</tr>
<tr>
<td valign="top">
<div id="controllerActions"></div>
</td>
</tr>
</table>
</td>
</table>
</div>
示例5: array
if ($error) {
?>
<div>
<?php
echo Helper::translate('srbac', 'There is an error in your configuration');
?>
<?php
$disabled = array('disabled' => true);
?>
</div>
<?php
}
?>
<?php
echo SHtml::hiddenField("action", "Install");
?>
<?php
echo SHtml::checkBox("demo", false, $disabled);
echo Helper::translate('srbac', 'Create demo authItems?');
?>
<br />
<?php
echo SHtml::submitButton(Helper::translate('srbac', 'Install'), $disabled);
?>
</div>
<?php
echo SHtml::endForm();
?>
</div>
示例6: actionSaveAllowed
public function actionSaveAllowed()
{
if (!Helper::isAlwaysAllowedFileWritable()) {
echo Helper::translate("srbac", "The always allowed file is not writable by the server") . "<br />";
echo "File : " . $this->module->getAlwaysAllowedFile();
return;
}
$allowed = array();
foreach ($_POST as $controller) {
foreach ($controller as $action) {
//Delete items
$auth = AuthItem::model()->findByPk($action);
if ($auth !== null) {
$auth->delete();
}
$allowed[] = $action;
}
}
$handle = fopen($this->module->getAlwaysAllowedFile(), "wb");
fwrite($handle, "<?php \n return array(\n\t'" . implode("',\n\t'", $allowed) . "'\n);\n?>");
fclose($handle);
$this->renderPartial("saveAllowed", array("allowed" => $allowed));
}
示例7: array
* @author Spyros Soldatos <spyros@valor.gr>
* @link http://code.google.com/p/srbac/
*/
/**
* Srbac main administration page
*
* @author Spyros Soldatos <spyros@valor.gr>
* @package srbac.views.authitem
* @since 1.0.2
*/
?>
<div class="marginBottom">
<div class="iconSet">
<div class="iconBox">
<?php
echo SHtml::link(SHtml::image($this->module->getIconsPath() . '/manageAuth.png', Helper::translate('srbac', 'Managing auth items'), array('class' => 'icon', 'title' => Helper::translate('srbac', 'Managing auth items'), 'border' => 0)) . " " . ($this->module->iconText ? Helper::translate('srbac', 'Managing auth items') : ""), array('authitem/manage'));
?>
</div>
<div class="iconBox">
<?php
echo SHtml::link(SHtml::image($this->module->getIconsPath() . '/usersAssign.png', Helper::translate('srbac', 'Assign to users'), array('class' => 'icon', 'title' => Helper::translate('srbac', 'Assign to users'), 'border' => 0)) . " " . ($this->module->iconText ? Helper::translate('srbac', 'Assign to users') : ""), array('authitem/assign'));
?>
</div>
<div class="iconBox">
<?php
echo SHtml::link(SHtml::image($this->module->getIconsPath() . '/users.png', Helper::translate('srbac', 'User\'s assignments'), array('class' => 'icon', 'title' => Helper::translate('srbac', 'User\'s assignments'), 'border' => 0)) . " " . ($this->module->iconText ? Helper::translate('srbac', 'User\'s assignments') : ""), array('authitem/assignments'));
?>
</div>
</div>
<div class="reset"></div>
</div>
示例8: array
/**
* success.php
*
* @author Spyros Soldatos <spyros@valor.gr>
* @link http://code.google.com/p/srbac/
*/
/**
* The successful installation view.
*
* @author Spyros Soldatos <spyros@valor.gr>
* @package srbac.views.authitem.install
* @since 1.0.0
*/
?>
<h3><?php
echo Helper::translate('srbac', 'Install Srbac');
?>
</h3>
<div>
<?php
echo Helper::translate('srbac', 'Srbac installed successfuly');
?>
</div>
<div>
<?php
echo SHtml::link(Helper::translate('srbac', 'Srbac frontpage'), array('frontpage'));
?>
</div>
示例9: array
$this->renderPartial('tabViews/taskAjax', array('model' => $model, 'userid' => $userid, 'data' => $data, 'message' => $message));
?>
</div>
</td>
</tr>
<tr valign="top">
<td><?php
echo SHtml::activeDropDownList(Assignments::model(), 'itemname', SHtml::listData(AuthItem::model()->findAll($criteria), 'name', 'name'), array('size' => $this->module->listBoxNumberOfLines, 'class' => 'dropdown', 'ajax' => array('type' => 'POST', 'url' => array('getOpers'), 'update' => '#operations', 'beforeSend' => 'function(){
$("#loadMessTask").addClass("srbacLoading");
}', 'complete' => 'function(){
$("#loadMessTask").removeClass("srbacLoading");
}')));
?>
<div>
<?php
echo Helper::translate("srbac", "Clever Assigning");
?>
:
<?php
echo SHtml::checkBox("clever", Yii::app()->getGlobalState("cleverAssigning"));
?>
</div>
</td>
</tr>
</table>
<br />
<div class="message" id="loadMessTask">
<?php
echo $message;
?>
示例10: array
<?php
/**
* create.php
*
* @author Spyros Soldatos <spyros@valor.gr>
* @link http://code.google.com/p/srbac/
*/
/**
* The create new auth item view.
*
* @author Spyros Soldatos <spyros@valor.gr>
* @package srbac.views.authitem.manage
* @since 1.0.0
*/
?>
<div class="title"><?php
echo Helper::translate('srbac', 'Create New Item');
?>
</div>
<?php
echo $this->renderPartial('manage/_form', array('model' => $model, 'update' => false), false, true);
示例11: array
</td>
<td>
<?php
echo SHtml::ajaxLink(SHtml::image($this->module->getIconsPath() . '/update.png', Helper::translate('srbac', 'Update'), array('border' => 0, 'title' => Helper::translate('srbac', 'Update'))), array('update', 'id' => $model->name), array('type' => 'POST', 'update' => '#preview', 'beforeSend' => 'function(){
$("#preview").addClass("srbacLoading");
}', 'complete' => 'function(){
$("#preview").removeClass("srbacLoading");
}'));
?>
</td>
<td>
<?php
if ($model->name != Helper::findModule('srbac')->superUser) {
?>
<?php
echo SHtml::ajaxLink(SHtml::image($this->module->getIconsPath() . '/delete.png', Helper::translate('srbac', 'Delete'), array('border' => 0, 'title' => Helper::translate('srbac', 'Delete'))), array('confirm', 'id' => $model->name), array('type' => 'POST', 'update' => '#preview', 'beforeSend' => 'function(){
$("#preview").addClass("srbacLoading");
}', 'complete' => 'function(){
$("#preview").removeClass("srbacLoading");
}'));
}
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
echo SHtml::endForm();
?>
示例12: afterSave
protected function afterSave()
{
parent::afterSave();
if ($this->oldName != $this->name) {
$this->model()->updateByPk($this->oldName, array("name" => $this->name));
$criteria = new CDbCriteria();
$criteria->condition = "itemname='" . $this->oldName . "'";
Assignments::model()->updateAll(array('itemname' => $this->name), $criteria);
$criteria->condition = "parent='" . $this->oldName . "'";
ItemChildren::model()->updateAll(array('parent' => $this->name), $criteria);
$criteria->condition = "child='" . $this->oldName . "'";
ItemChildren::model()->updateAll(array('child' => $this->name), $criteria);
Yii::app()->user->setFlash('updateName', Helper::translate('srbac', 'Updating list'));
}
}
示例13:
<?php
/**
* unauthorized.php
*
* @author Spyros Soldatos <spyros@valor.gr>
* @link http://code.google.com/p/srbac/
*/
/**
* Default page shown when a not authorized user tries to access a page
*
* @author Spyros Soldatos <spyros@valor.gr>
* @package srbac.views.authitem
* @since 1.0.2
*/
?>
<h2 style="color:red">
<?php
echo Helper::translate('srbac', "Error:") . $error["code"] . " '" . $error["title"] . "'";
?>
</h2>
<p>
<?php
echo $error["message"];
?>
</p>
示例14: array
<div class="srbac">
<?php
echo SHtml::beginForm();
?>
<?php
echo SHtml::errorSummary($model);
?>
<table width="100%">
<tr><th colspan="2"><?php
echo Helper::translate('srbac', 'Assign Tasks to Roles');
?>
</th></tr>
<tr>
<th width="50%">
<?php
echo SHtml::label(Helper::translate('srbac', "Role"), 'role');
?>
</th>
<td width="50%" rowspan="2">
<div id="tasks">
<?php
$this->renderPartial('tabViews/roleAjax', array('model' => $model, 'userid' => $userid, 'data' => $data, 'message' => $message));
?>
</div>
</td>
</tr>
<tr valign="top">
<td><?php
echo SHtml::activeDropDownList(AuthItem::model(), 'name[0]', SHtml::listData(AuthItem::model()->findAll($criteria), 'name', 'name'), array('size' => $this->module->listBoxNumberOfLines, 'class' => 'dropdown', 'ajax' => array('type' => 'POST', 'url' => array('getTasks'), 'update' => '#tasks', 'beforeSend' => 'function(){
$("#loadMessRole").addClass("srbacLoading");
}', 'complete' => 'function(){
示例15:
<h1>Assignments of user : '<?php
echo $username;
?>
'</h1>
<table class="srbacDataGrid" width="100%">
<tr>
<th class="roles"><?php
echo Helper::translate('srbac', 'Roles');
?>
</th>
<th class="tasks"><?php
echo Helper::translate('srbac', 'Tasks');
?>
</th>
<th class="operations"><?php
echo Helper::translate('srbac', 'Operations');
?>
</th>
</tr>
<tr>
<td valign="top" colspan="3">
<table class="roles">
<?php
foreach ($data as $i => $roles) {
?>
<tr>
<td><b><?php
echo $i;
?>
</b>
<?php