本文整理汇总了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'];
}
}
示例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
}
示例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'];
}
}
示例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
}
示例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'];
}
示例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);
}
}
示例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'];
}
示例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();
}
示例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();
}
示例10: __construct
public function __construct($oModelReflection, $sId)
{
parent::__construct($oModelReflection, $sId);
$this->aProperties['class'] = 'Contact';
$this->aCSSClasses[] = 'dashlet-inline';
$this->aCSSClasses[] = 'dashlet-badge';
}
示例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);
}