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


PHP Dashlet::__construct方法代码示例

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


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

示例1: translate

 function __construct($id, $options = null)
 {
     parent::__construct($id);
     $this->isConfigurable = true;
     if (empty($this->title)) {
         $this->title = translate('LBL_DASHLET_TITLE', 'Home');
         $this->title = translate('LBL_DASHLET_DISCOVER_SUGAR_PRO', 'Home');
     }
     if (!empty($options['titleLabel'])) {
         $this->title = translate($options['titleLabel'], 'Home');
     } elseif (!empty($options['title'])) {
         $this->title = $options['title'];
     }
     if (empty($options['url'])) {
         $this->url = $this->defaultURL;
         $this->url = 'https://suitecrm.com/';
     } else {
         $this->url = $options['url'];
     }
     if (empty($options['height']) || (int) $options['height'] < 1) {
         $this->height = 315;
     } else {
         $this->height = (int) $options['height'];
     }
     if (isset($options['autoRefresh'])) {
         $this->autoRefresh = $options['autoRefresh'];
     }
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:28,代码来源:iFrameDashlet.php

示例2: __construct

 /**
  * Constructor
  *
  * @global string current language
  * @param guid $id id for the current dashlet (assigned from Home module)
  * @param array $def options saved for this dashlet
  */
 public function __construct($id, $def)
 {
     $this->loadLanguage('RSSDashlet', 'modules/Home/Dashlets/');
     // load the language strings here
     if (!empty($def['height'])) {
         // set a default height if none is set
         $this->height = $def['height'];
     }
     if (!empty($def['url'])) {
         $this->url = $def['url'];
     }
     if (!empty($def['title'])) {
         $this->title = $def['title'];
     } else {
         $this->title = $this->dashletStrings['LBL_TITLE'];
     }
     if (isset($def['autoRefresh'])) {
         $this->autoRefresh = $def['autoRefresh'];
     }
     parent::__construct($id);
     // call parent constructor
     $this->isConfigurable = true;
     // dashlet is configurable
     $this->hasScript = false;
     // dashlet has javascript attached to it
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:33,代码来源:RSSDashlet.php

示例3:

 /**
  * Constructor
  *
  * @global string current language
  * @param guid $id id for the current dashlet (assigned from Home module)
  * @param array $def options saved for this dashlet
  */
 function __construct($id, $def)
 {
     $this->loadLanguage('JotPadDashlet');
     // load the language strings here
     if (!empty($def['savedText'])) {
         // load default text is none is defined
         $this->savedText = $def['savedText'];
     } else {
         $this->savedText = $this->dashletStrings['LBL_DEFAULT_TEXT'];
     }
     if (!empty($def['height'])) {
         // set a default height if none is set
         $this->height = $def['height'];
     }
     parent::__construct($id);
     // call parent constructor
     $this->isConfigurable = true;
     // dashlet is configurable
     $this->hasScript = true;
     // dashlet has javascript attached to it
     // if no custom title, use default
     if (empty($def['title'])) {
         $this->title = $this->dashletStrings['LBL_TITLE'];
     } else {
         $this->title = $def['title'];
     }
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:34,代码来源:JotPadDashlet.php

示例4: array

 /**
  * Constructor
  *
  * @global string current language
  * @param guid $id id for the current dashlet (assigned from Home module)
  * @param report_id $report_id id of the saved report
  * @param array $def options saved for this dashlet
  */
 function __construct($id, $report_id, $def)
 {
     $this->report_id = $report_id;
     $this->loadLanguage('ChartsDashlet');
     // load the language strings here
     parent::__construct($id);
     // call parent constructor
     $this->searchFields = array();
     $this->isConfigurable = true;
     // dashlet is configurable
     $this->hasScript = true;
     // dashlet has javascript attached to it
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:21,代码来源:ChartsDashlet.php

示例5:

    function __construct($id, $def) {
        $this->loadLanguage('CalendarDashlet','modules/Calendar/Dashlets/');

		parent::__construct($id);

		$this->isConfigurable = true;
		$this->hasScript = true;

		if(empty($def['title']))
			$this->title = $this->dashletStrings['LBL_TITLE'];
		else
			$this->title = $def['title'];

		if(!empty($def['view']))
			$this->view = $def['view'];

    }
开发者ID:auf,项目名称:crm_auf_org,代码行数:17,代码来源:CalendarDashlet.php

示例6: __construct

 /**
  * Constructor
  *
  * @see Dashlet::Dashlet()
  */
 public function __construct($id, $def = null)
 {
     global $current_user, $app_strings;
     parent::__construct($id);
     $this->isConfigurable = true;
     $this->isRefreshable = true;
     if (empty($def['title'])) {
         $this->title = translate('LBL_TOP_CAMPAIGNS', 'Campaigns');
     } else {
         $this->title = $def['title'];
     }
     if (isset($def['autoRefresh'])) {
         $this->autoRefresh = $def['autoRefresh'];
     }
     $this->seedBean = new Opportunity();
     $qry = "SELECT C.name AS campaign_name, SUM(O.amount) AS revenue, C.id as campaign_id " . "FROM campaigns C, opportunities O " . "WHERE C.id = O.campaign_id " . "AND O.sales_stage = 'Closed Won' " . "AND O.deleted = 0 " . "GROUP BY C.name,C.id ORDER BY revenue desc";
     $result = $this->seedBean->db->limitQuery($qry, 0, 10);
     $row = $this->seedBean->db->fetchByAssoc($result);
     while ($row != null) {
         array_push($this->top_campaigns, $row);
         $row = $this->seedBean->db->fetchByAssoc($result);
     }
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:28,代码来源:TopCampaignsDashlet.php

示例7: __construct

 /**
  * @see Dashlet::Dashlet()
  */
 public function __construct($id, $def = null)
 {
     global $current_user, $app_strings;
     parent::__construct($id);
     $this->isConfigurable = true;
     $this->isRefreshable = true;
     if (empty($def['title'])) {
         $this->title = translate('LBL_MY_CLOSED_OPPORTUNITIES', 'Opportunities');
     } else {
         $this->title = $def['title'];
     }
     if (isset($def['autoRefresh'])) {
         $this->autoRefresh = $def['autoRefresh'];
     }
     $this->seedBean = new Opportunity();
     $qry = "SELECT * from opportunities WHERE assigned_user_id = '" . $current_user->id . "' AND deleted=0";
     $result = $this->seedBean->db->query($this->seedBean->create_list_count_query($qry));
     $row = $this->seedBean->db->fetchByAssoc($result);
     $this->total_opportunities = $row['c'];
     $qry = "SELECT * from opportunities WHERE assigned_user_id = '" . $current_user->id . "' AND sales_stage = 'Closed Won'  AND deleted=0";
     $result = $this->seedBean->db->query($this->seedBean->create_list_count_query($qry));
     $row = $this->seedBean->db->fetchByAssoc($result);
     $this->total_opportunities_won = $row['c'];
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:27,代码来源:MyClosedOpportunitiesDashlet.php

示例8: array

 function __construct($id, $def = array())
 {
     global $current_user, $app_strings;
     parent::__construct($id);
     $this->isConfigurable = true;
     $this->def = $def;
     if (empty($def['dashletTitle'])) {
         $this->title = translate('LBL_AOR_REPORTS_DASHLET', 'AOR_Reports');
     } else {
         $this->title = $def['dashletTitle'];
     }
     $this->params = array();
     if (!empty($def['parameter_id'])) {
         foreach ($def['parameter_id'] as $key => $parameterId) {
             $this->params[$parameterId] = array('id' => $parameterId, 'operator' => $def['parameter_operator'][$key], 'type' => $def['parameter_type'][$key], 'value' => $def['parameter_value'][$key]);
         }
     }
     if (!empty($def['aor_report_id'])) {
         $this->report = BeanFactory::getBean('AOR_Reports', $def['aor_report_id']);
         $this->report->user_parameters = $this->params;
     }
     $this->onlyCharts = !empty($def['onlyCharts']);
     $this->charts = !empty($def['charts']) ? $def['charts'] : array();
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:24,代码来源:AORReportsDashlet.php

示例9: LayoutManager

 function __construct($id, $options = null)
 {
     parent::__construct($id);
     $this->isConfigurable = true;
     if (isset($options)) {
         if (!empty($options['filters'])) {
             $this->filters = $options['filters'];
         }
         if (!empty($options['title'])) {
             $this->title = $options['title'];
         }
         if (!empty($options['displayRows'])) {
             $this->displayRows = $options['displayRows'];
         }
         if (!empty($options['displayColumns'])) {
             $this->displayColumns = $options['displayColumns'];
         }
         if (isset($options['myItemsOnly'])) {
             $this->myItemsOnly = $options['myItemsOnly'];
         }
         if (isset($options['autoRefresh'])) {
             $this->autoRefresh = $options['autoRefresh'];
         }
     }
     $this->layoutManager = new LayoutManager();
     $this->layoutManager->setAttribute('context', 'Report');
     // fake a reporter object here just to pass along the db type used in many widgets.
     // this should be taken out when sugarwidgets change
     $temp = (object) array('db' => &$GLOBALS['db'], 'report_def_str' => '');
     $this->layoutManager->setAttributePtr('reporter', $temp);
     $this->lvs = new ListViewSmarty();
 }
开发者ID:samus-aran,项目名称:SuiteCRM,代码行数:32,代码来源:DashletGeneric.php

示例10: __construct

 public function __construct($oModelReflection, $sId)
 {
     parent::__construct($oModelReflection, $sId);
     $this->aProperties['class'] = 'Contact';
     $this->aCSSClasses[] = 'dashlet-inline';
     $this->aCSSClasses[] = 'dashlet-badge';
 }
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:7,代码来源:dashlet.class.inc.php

示例11: __construct

 /**
  * Constructor
  *
  * @param int   $id
  * @param array $options
  */
 public function __construct($id, array $options = null)
 {
     parent::__construct($id);
     if (isset($options)) {
         foreach ($options as $key => $value) {
             $this->{$key} = $value;
         }
     }
     // load searchfields
     $classname = get_class($this);
     if (is_file("modules/Charts/Dashlets/{$classname}/{$classname}.data.php")) {
         require "modules/Charts/Dashlets/{$classname}/{$classname}.data.php";
         $this->_searchFields = $dashletData[$classname]['searchFields'];
     }
     // load language files
     $this->loadLanguage($classname, 'modules/Charts/Dashlets/');
     if (empty($options['title'])) {
         $this->title = $this->dashletStrings['LBL_TITLE'];
     }
     if (isset($options['autoRefresh'])) {
         $this->autoRefresh = $options['autoRefresh'];
     }
     $this->layoutManager = new LayoutManager();
     $this->layoutManager->setAttribute('context', 'Report');
     // fake a reporter object here just to pass along the db type used in many widgets.
     // this should be taken out when sugarwidgets change
     $temp = (object) array('db' => &$GLOBALS['db'], 'report_def_str' => '');
     $this->layoutManager->setAttributePtr('reporter', $temp);
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:35,代码来源:DashletGenericChart.php


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