当前位置: 首页>>代码示例>>PHP>>正文


PHP Modules::itemDisplayName方法代码示例

本文整理汇总了PHP中Modules::itemDisplayName方法的典型用法代码示例。如果您正苦于以下问题:PHP Modules::itemDisplayName方法的具体用法?PHP Modules::itemDisplayName怎么用?PHP Modules::itemDisplayName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Modules的用法示例。


在下文中一共展示了Modules::itemDisplayName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parseModelName

 /**
  * Parse an associationType field and resolve the model name
  * @param string $model Model type to resolve
  * @return string Model's name
  */
 public static function parseModelName($model)
 {
     $customModule = Modules::model()->findByAttributes(array('custom' => 1, 'name' => $model));
     if ($customModule) {
         //$model = $customModule->title;
         $model = Modules::itemDisplayName($customModule->name);
         $model = strtolower($model);
     } else {
         switch ($model) {
             case 'Product':
                 $model .= 's';
                 break;
             case 'Quote':
                 $model .= 's';
                 break;
             case 'Opportunity':
                 $model = str_replace('y', 'ies', $model);
                 break;
         }
         $requestedModel = $model;
         $model = Modules::displayName(false, ucfirst($model));
         $model = strtolower($model);
         if (empty($model)) {
             // If the model type couldn't be resolved, check for special cases
             // of models without a dedicated module
             if ($requestedModel === 'AnonContact') {
                 $model = 'anonymous contact';
             } else {
                 if ($requestedModel === 'Campaign') {
                     $model = 'campaign';
                 }
             }
         }
     }
     return Yii::t('app', $model);
 }
开发者ID:shuvro35,项目名称:X2CRM,代码行数:41,代码来源:Events.php

示例2: actionRenameModules

 /**
  * Change the title of a module.
  *
  * This allows for the configuration of the display name of a module. Before
  * version 5.0, this would not affect text other than the top bar menu.
  */
 public function actionRenameModules()
 {
     $order = Modules::model()->findAllByAttributes(array('visible' => 1));
     $menuItems = array();
     $itemNames = array();
     foreach ($order as $module) {
         $menuItems[$module->name] = Yii::t('app', $module->title);
         if ($module->custom || $module->name === 'bugReports') {
             $itemNames[$module->name] = Modules::itemDisplayName($module->name);
         }
     }
     foreach ($menuItems as $key => $value) {
         $menuItems[$key] = preg_replace('/:/', ':', $value);
         // decode any colons
     }
     if (isset($_POST['module']) && isset($_POST['name'])) {
         $module = $_POST['module'];
         $name = $_POST['name'];
         if (empty($module)) {
             Yii::app()->user->setFlash('error', Yii::t('admin', "You must select a module."));
         } else {
             $moduleRecord = Modules::model()->findByAttributes(array('name' => $module, 'title' => $menuItems[$module]));
             if (isset($moduleRecord)) {
                 $match = Modules::model()->findByAttributes(array('title' => $name));
                 $itemName = isset($_POST['itemName']) ? $_POST['itemName'] : "";
                 if (empty($name)) {
                     Yii::app()->user->setFlash('error', Yii::t('admin', "You must specify a title."));
                 } else {
                     if (isset($match) && $match->name !== $moduleRecord->name) {
                         Yii::app()->user->setFlash('error', Yii::t('admin', "A module with this title already exists."));
                     } else {
                         $moduleRecord->title = $name;
                         if (!empty($itemName) && ($moduleRecord->custom || $moduleRecord->name === 'bugReports')) {
                             $moduleRecord->itemName = $itemName;
                         }
                         if ($moduleRecord->retitle($name)) {
                             $this->redirect('index');
                         }
                     }
                 }
             }
         }
     }
     $this->render('renameModules', array('modules' => $menuItems, 'itemNames' => $itemNames));
 }
开发者ID:xl602,项目名称:X2CRM,代码行数:51,代码来源:AdminController.php

示例3: array

 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact X2Engine, Inc. P.O. Box 66752, Scotts Valley,
 * California 95067, USA. or at email address contact@x2engine.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2Engine".
 *****************************************************************************************/
include "protected/modules/templates/templatesConfig.php";
$this->actionMenu = $this->formatMenu(array(array('label' => Yii::t('module', '{X} List', array('{X}' => Modules::itemDisplayName())), 'url' => array('index')), array('label' => Yii::t('module', 'Create {X}', array('{X}' => Modules::itemDisplayName())))));
?>
<div class="page-title"><h2><?php 
echo Yii::t('module', 'Create New {X}', array('{X}' => Modules::itemDisplayName()));
?>
</h2></div>

<?php 
echo $this->renderPartial('application.components.views._form', array('model' => $model, 'users' => $users, 'modelName' => 'templates'));
开发者ID:keyeMyria,项目名称:CRM,代码行数:31,代码来源:create.php

示例4: array

 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact X2Engine, Inc. P.O. Box 66752, Scotts Valley,
 * California 95067, USA. or at email address contact@x2engine.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2Engine".
 *****************************************************************************************/
include "protected/modules/bugReports/bugReportsConfig.php";
$this->actionMenu = $this->formatMenu(array(array('label' => Yii::t('module', '{X} List', array('{X}' => Modules::itemDisplayName())), 'url' => array('index')), array('label' => Yii::t('module', 'Create {X}', array('{X}' => Modules::itemDisplayName())), 'url' => array('create')), array('label' => Yii::t('module', 'View {X}', array('{X}' => Modules::itemDisplayName())), 'url' => array('view', 'id' => $model->id)), array('label' => Yii::t('module', 'Update {X}', array('{X}' => Modules::itemDisplayName()))), array('label' => Yii::t('module', 'Delete {X}', array('{X}' => Modules::itemDisplayName())), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?')))));
?>
<div class="page-title"><h2><?php 
echo Yii::t('module', 'Update {X}', array('{X}' => Modules::itemDisplayName()));
?>
 #<?php 
echo $model->id;
?>
</h2></div>

<?php 
$this->widget('FormView', array('model' => $model));
//echo $this->renderPartial('application.components.views.@FORMVIEW', array('model'=>$model,'users'=>$users, 'modelName'=>'bugReports'));
开发者ID:dsyman2,项目名称:X2CRM,代码行数:31,代码来源:update.php

示例5: array

 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact X2Engine, Inc. P.O. Box 66752, Scotts Valley,
 * California 95067, USA. or at email address contact@x2engine.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2Engine".
 *****************************************************************************************/
include "protected/modules/bugReports/bugReportsConfig.php";
$this->actionMenu = $this->formatMenu(array(array('label' => Yii::t('module', '{X} List', array('{X}' => Modules::itemDisplayName()))), array('label' => Yii::t('module', 'Create {X}', array('{X}' => Modules::itemDisplayName())), 'url' => array('create')), array('label' => Yii::t('module', 'Import {X}', array('{X}' => Modules::itemDisplayName())), 'url' => array('admin/importModels', 'model' => ucfirst($moduleConfig['moduleName'])), 'visibility' => Yii::app()->params->isAdmin), array('label' => Yii::t('module', 'Export {X}', array('{X}' => Modules::itemDisplayName())), 'url' => array('admin/exportModels', 'model' => ucfirst($moduleConfig['moduleName'])), 'visibility' => Yii::app()->params->isAdmin)));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('opportunities-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->
<?php 
$this->widget('X2GridView', array('id' => 'bugReports-grid', 'title' => $moduleConfig['title'], 'buttons' => array('advancedSearch', 'clearFilters', 'columnSelector', 'autoResize', 'showHidden'), 'template' => '<div class="page-title">{title}{buttons}{filterHint}{summary}</div>{items}{pager}', 'dataProvider' => $model->searchWithStatusFilter(), 'filter' => $model, 'modelName' => 'bugReports', 'viewName' => 'bugReports', 'defaultGvSettings' => array('subject' => 100, 'severity' => 65, 'status' => 65, 'type' => 65, 'description' => 180, 'assignedTo' => 100), 'specialColumns' => array('name' => array('name' => 'name', 'value' => 'CHtml::link($data->renderAttribute("name"),array("view","id"=>$data->id))', 'type' => 'raw'), 'subject' => array('name' => 'subject', 'value' => 'CHtml::link($data->renderAttribute("subject"),array("view","id"=>$data->id))', 'type' => 'raw'), 'description' => array('name' => 'description', 'header' => Yii::t('app', 'Description'), 'value' => 'Formatter::trimText($data->renderAttribute("description"))', 'type' => 'raw'), 'severity' => array('name' => 'severity', 'header' => Yii::t('app', 'Severity'), 'value' => 'X2Model::model("Dropdowns")->getDropdownValue(116,$data->renderAttribute("severity"))', 'type' => 'raw')), 'enableControls' => true, 'fullscreen' => true));
开发者ID:dsyman2,项目名称:X2CRM,代码行数:31,代码来源:index.php

示例6: array

 * 
 * You can contact X2Engine, Inc. P.O. Box 66752, Scotts Valley,
 * California 95067, USA. or at email address contact@x2engine.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2Engine".
 *****************************************************************************************/
include "protected/modules/templates/templatesConfig.php";
$this->actionMenu = $this->formatMenu(array(array('label' => Yii::t('module', '{X} List', array('{X}' => Modules::itemDisplayName())), 'url' => array('index')), array('label' => Yii::t('module', 'Create {X}', array('{X}' => Modules::itemDisplayName())), 'url' => array('create'))));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('templates-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h2><?php 
echo Yii::t('module', 'Manage {X}', array('{X}' => $moduleConfig['title']));
?>
</h2>
<?php 
echo Yii::t('app', 'You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.');
?>
<br />
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
开发者ID:tymiles003,项目名称:X2CRM,代码行数:31,代码来源:admin.php


注:本文中的Modules::itemDisplayName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。