本文整理汇总了PHP中_M函数的典型用法代码示例。如果您正苦于以下问题:PHP _M函数的具体用法?PHP _M怎么用?PHP _M使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_M函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: menu
public static function menu()
{
if (!Acl::is_user() || !Base_AclCommon::check_permission('Fax - Browse')) {
return array();
}
return array(_M('CRM') => array('__submenu__' => 1, _M('Fax') => array()));
}
示例2: menu
public static function menu()
{
if (Base_AclCommon::check_permission('Shoutbox')) {
return array(_M('Shoutbox') => array());
}
return array();
}
示例3: setShowValues
public function setShowValues($show)
{
if (!is_bool($show)) {
throw new EControlException(_M($this->className . ':: setShowValues() - This method expects an boolean as parameter!'));
}
$this->showValues = $show;
}
示例4: __construct
public function __construct($message = NULL, $code = 0)
{
if (!$message) {
$message = _M('Unknow exception') . get_class($this);
}
parent::__construct($message, $code);
}
示例5: install
public function install() {
$fields = array(
array('name' => _M('Project Name'), 'type'=>'text', 'required'=>true, 'param'=>'64', 'extra'=>false, 'visible'=>true,'display_callback'=>array('Tests_BugtrackCommon', 'display_bugtrack')),
array('name' => _M('Company Name'), 'type'=>'select', 'required'=>true, 'param'=>array('company'=>'Company Name'), 'extra'=>false, 'visible'=>true),
array('name' => _M('Due Date'), 'type'=>'date', 'required'=>true, 'param'=>64, 'extra'=>false, 'visible'=>true),
array('name' => _M('Status'), 'type'=>'commondata', 'required'=>true, 'param'=>'Bugtrack_Status', 'extra'=>false,'visible'=>true),
array('name' => _M('Description'), 'type'=>'long text', 'required'=>false, 'param'=>'64', 'extra'=>false)
);
Utils_RecordBrowserCommon::install_new_recordset('bugtrack', $fields);
Utils_RecordBrowserCommon::new_filter('bugtrack', 'Company Name');
Utils_RecordBrowserCommon::set_quickjump('bugtrack', 'Project Name');
Utils_RecordBrowserCommon::set_favorites('bugtrack', true);
Utils_RecordBrowserCommon::set_recent('bugtrack', 15);
Utils_RecordBrowserCommon::set_caption('bugtrack', _M('Bugtrack'));
Utils_RecordBrowserCommon::set_icon('bugtrack', Base_ThemeCommon::get_template_filename('Tests/Bugtrack', 'icon.png'));
// ************ addons ************** //
Utils_AttachmentCommon::new_addon('bugtrack');
Utils_RecordBrowserCommon::new_addon('company', 'Tests/Bugtrack', 'company_bugtrack_addon', 'Bugtrack');
// ************ other ************** //
Utils_CommonDataCommon::new_array('Bugtrack_Status',array('new'=>_M('New'),'inprog'=>_M('In Progress'),'cl'=>_M('Closed')),true,true);
Utils_RecordBrowserCommon::add_access('bugtrack', 'view', 'ACCESS:employee');
Utils_RecordBrowserCommon::add_access('bugtrack', 'add', 'ACCESS:employee');
Utils_RecordBrowserCommon::add_access('bugtrack', 'edit', 'ACCESS:employee');
Utils_RecordBrowserCommon::add_access('bugtrack', 'delete', array('ACCESS:employee', 'ACCESS:manager'));
return true;
}
示例6: _addControl
protected function _addControl($control, $pos = 0, $op = 'add')
{
if (is_null($control)) {
return;
} elseif (is_array($control)) {
foreach ($control as $c) {
$this->_addControl($c);
}
return;
} elseif (!is_object($control)) {
$control = new MRawControl($control);
}
if ($control instanceof MControl) {
if ($control->getAjax() == null) {
$control->setAjax($this->getAjax());
}
if ($op == 'add') {
$this->controls->add($control);
} elseif ($op == 'ins') {
$this->controls->insert($control, $pos);
} elseif ($op == 'set') {
$this->controls->set($pos, $control);
}
$control->owner = $this;
} else {
throw new EControlException(_M('Using non-control with MContainerControl::_addControl: ' . $control));
}
}
示例7: install
public function install() {
Base_ThemeCommon::install_default_theme($this->get_type());
$ret = true;
$ret &= DB::CreateTable('utils_messenger_message','
id I4 AUTO KEY,
callback_method C(255) NOTNULL,
callback_args X,
message X,
created_by I4 NOTNULL,
created_on T NOTNULL,
alert_on T,
parent_module C(32) NOTNULL,
page_id C(32) NOTNULL',
array('constraints'=>', FOREIGN KEY (created_by) REFERENCES user_login(ID)'));
if(!$ret){
print('Unable to create table utils_messenger_message.<br>');
return false;
}
$ret &= DB::CreateTable('utils_messenger_users','
message_id I4,
done I1 DEFAULT 0,
user_login_id I4,
done_on T,
follow I1 DEFAULT 0',
array('constraints'=>' , FOREIGN KEY (message_id) REFERENCES utils_messenger_message(id), FOREIGN KEY (user_login_id) REFERENCES user_login(ID)'));
if(!$ret){
print('Unable to create table utils_messenger_users.<br>');
return false;
}
Base_AclCommon::add_permission(_M('Messenger Alerts'),array('ACCESS:employee'));
return $ret;
}
示例8: checkAccess
public function checkAccess($module, $action, $deny = false, $group = false)
{
if ($this->auth->isLogged()) {
$login = $this->auth->getLogin();
// MLogin object
$isAdmin = $login->isAdmin();
// Is administrator?
$rights = $login->rights[$module];
// user rights
if (!$rights) {
$login->setRights($this->getRights($login->id));
}
$ok = @in_array($action, $login->rights[$module]);
if (!$ok && $group) {
$groups = $this->getGroupsAllowed($module, $action);
$ok = sizeof(array_intersect($groups, $login->groups)) > 0;
}
}
if (!$ok && $deny) {
$msg = _M('Access Denied') . "<br><br>\n" . '<center><big><i><font color=red>' . _M('Transaction: ') . "{$transaction}</font></i></big></center><br><br>\n" . _M('Please inform a valid login/password to access this content.') . "<br>";
$users = $this->getUsersAllowed($module, $action);
if ($users) {
$msg .= "<br><br>\n" . _M('Users with access rights') . ":<ul><li>" . implode('<li>', $users) . '</ul>';
}
$go = $this->manager->history->back('action');
$error = Prompt::error($msg, $go, $caption, '');
$error->addButton(_M(' Login '), $this->manager->getActionURL($this->manager->getConf('login.module'), 'login', null, array('return_to' => urlencode($this->manager->history->top()))), '');
$this->manager->prompt($error, $deny);
//$this->manager->error($msg, $go);
}
return $ok;
}
示例9: install
public function install()
{
Base_AclCommon::add_permission(_M('View Activity Report'), array('ACCESS:employee', 'ACCESS:manager'));
Base_ThemeCommon::install_default_theme($this->get_type());
Utils_RecordBrowserCommon::new_addon('contact', 'Apps/ActivityReport', 'contact_addon', array('Apps_ActivityReportCommon', 'contact_addon_label'));
return true;
}
示例10: menu
public static function menu()
{
if (Base_AclCommon::check_permission('Advanced User Settings')) {
return array(_M('My settings') => array('__weight__' => 10, '__submenu__' => 1, _M('Control panel') => array()));
}
return array();
}
示例11: install
public function install()
{
Base_ThemeCommon::install_default_theme('CRM/Calendar');
Base_AclCommon::add_permission(_M('Calendar'), array('ACCESS:employee'));
DB::CreateTable('crm_calendar_custom_events_handlers', 'id I4 AUTO KEY,' . 'group_name C(64),' . 'handler_callback C(128)', array('constraints' => ''));
return true;
}
示例12: install
public function install()
{
Base_ThemeCommon::install_default_theme('CRM/Contacts/Activities');
Utils_RecordBrowserCommon::new_addon('company', 'CRM/Contacts/Activities', 'company_activities', _M('Activities'));
Utils_RecordBrowserCommon::new_addon('contact', 'CRM/Contacts/Activities', 'contact_activities', _M('Activities'));
return true;
}
示例13: setChecked
public function setChecked($checked)
{
if (!is_bool($checked)) {
throw new EControlException(_M($this->className . ':: setChecked() - This method expects an boolean as parameter!'));
}
$this->checked = $checked;
}
示例14: dispatch
public function dispatch($action)
{
mtrace('mcontroller::dispatch = ' . $action);
if (!method_exists($this, $action)) {
mtrace('action does not exists = ' . $action);
try {
$this->render($action);
} catch (Exception $e) {
throw new ERunTimeException(_M("App: [{$this->application}], Module: [{$this->module}], Controller: [{$this->name}] : action [{$action}] not found!"));
}
} else {
try {
$this->action = $action;
if (MPage::isPostBack()) {
$actionPost = $action . 'Post';
if (method_exists($this, $actionPost)) {
$action = $actionPost;
}
}
mtrace('executing = ' . $action);
$this->{$action}();
} catch (Exception $e) {
mdump($e->getMessage());
if (\Manager::PROD()) {
$this->renderPrompt('error', $e->getMessage());
} else {
$this->renderPrompt('error', "[<b>" . $this->name . '/' . $action . "</b>]" . $e->getMessage());
}
}
}
}
示例15: install
public function install()
{
global $database;
$ret = true;
$ret &= DB::CreateTable('base_user_settings', '
user_login_id I4 NOTNULL,
module C(128) NOTNULL,
variable C(64) NOTNULL,
value X NOTNULL', array('constraints' => ', FOREIGN KEY (user_login_id) REFERENCES user_login(id), PRIMARY KEY(user_login_id,module,variable)'));
if (!$ret) {
print 'Unable to create table base_user_settings.<br>';
return false;
}
$ret &= DB::CreateTable('base_user_settings_admin_defaults', '
module C(128) NOTNULL,
variable C(64) NOTNULL,
value X NOTNULL', array('constraints' => ', PRIMARY KEY(module,variable)'));
if (!$ret) {
print 'Unable to create table base_user_settings_defaults.<br>';
return false;
}
Base_ThemeCommon::install_default_theme(Base_User_SettingsInstall::module_name());
Base_AclCommon::add_permission(_M('Advanced User Settings'), array('ACCESS:employee'));
return $ret;
}