forked from tsolucio/corebos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Smarty_setup.php
56 lines (49 loc) · 2.7 KB
/
Smarty_setup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
require 'Smarty/libs/Smarty.class.php';
include_once 'include/smarty/function.process_widget.php';
include_once 'include/smarty/function.get_custom_header.php';
class vtigerCRM_Smarty extends Smarty {
/** Cache the tag cloud display information for re-use */
public static $_tagcloud_display_cache = array();
public static function lookupTagCloudView($userid) {
if (!isset(self::$_tagcloud_display_cache[$userid])) {
self::$_tagcloud_display_cache[$userid] = (getTagCloudView($userid) ? 'true' : 'false');
}
return self::$_tagcloud_display_cache[$userid];
}
/** This function sets the smarty directory path for the member variables */
public function __construct() {
global $current_user, $currentModule;
parent::__construct();
$this->setTemplateDir('Smarty/templates');
$this->setCompileDir('Smarty/templates_c');
$this->setConfigDir('Smarty/configs');
$this->setCacheDir('Smarty/cache');
$this->setPluginsDir('Smarty/libs/plugins');
$CALENDAR_DISPLAY = GlobalVariable::getVariable('Application_Display_Mini_Calendar', 1, $currentModule);
$CALENDAR_DISPLAY = empty($CALENDAR_DISPLAY) ? 'false' : 'true';
$WORLD_CLOCK_DISPLAY = GlobalVariable::getVariable('Application_Display_World_Clock', 1, $currentModule);
$WORLD_CLOCK_DISPLAY = empty($WORLD_CLOCK_DISPLAY) ? 'false' : 'true';
$this->assign('CALENDAR_DISPLAY', $CALENDAR_DISPLAY);
$this->assign('WORLD_CLOCK_DISPLAY', $WORLD_CLOCK_DISPLAY);
$this->assign('CURRENT_USER_ID', (isset($current_user) ? $current_user->id : 0));
$this->assign('Application_JSCalendar_Load', GlobalVariable::getVariable('Application_JSCalendar_Load', 1, $currentModule));
// Query For TagCloud only when required
if ((isset($_REQUEST['action']) && $_REQUEST['action'] == 'DetailView') || (isset($_REQUEST['file']) && $_REQUEST['file'] == 'DetailViewAjax')) {
//Added to provide User based Tagcloud
$this->assign('TAG_CLOUD_DISPLAY', self::lookupTagCloudView((isset($current_user) ? $current_user->id : '')));
}
$this->loadFilter('output', 'trimwhitespace');
$this->registerPlugin('function', 'process_widget', 'smarty_function_process_widget');
$this->registerPlugin('function', 'corebos_header', 'smarty_function_getCustomHeader');
}
}
?>