Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
ZurmoExternalDefaultPageView.php
1 <?php
2  /*********************************************************************************
3  * Zurmo is a customer relationship management program developed by
4  * Zurmo, Inc. Copyright (C) 2017 Zurmo Inc.
5  *
6  * Zurmo is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License version 3 as published by the
8  * Free Software Foundation with the addition of the following permission added
9  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10  * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
11  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
12  *
13  * Zurmo is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Affero General Public License along with
19  * this program; if not, see http://www.gnu.org/licenses or write to the Free
20  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA.
22  *
23  * You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
24  * Suite 370 Chicago, IL 60606. or at email address contact@zurmo.com.
25  *
26  * The interactive user interfaces in original and modified versions
27  * of this program must display Appropriate Legal Notices, as required under
28  * Section 5 of the GNU Affero General Public License version 3.
29  *
30  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31  * these Appropriate Legal Notices must retain the display of the Zurmo
32  * logo and Zurmo copyright notice. If the display of the logo is not reasonably
33  * feasible for technical reasons, the Appropriate Legal Notices must display the words
34  * "Copyright Zurmo Inc. 2017. All rights reserved".
35  ********************************************************************************/
36 
41  {
42  public function __construct(View $view)
43  {
44  parent::__construct(new ZurmoExternalDefaultView($view));
45  }
46 
47  public function render()
48  {
49  static::registerAllPagesScriptFiles();
50  static::registerExternalPageScriptFiles();
51  $content = $this->renderXHtmlHead() .
52  $this->renderXHtmlBodyStart() .
53  View::render() .
54  $this->renderXHtmlBodyEnd();
55  Yii::app()->getClientScript()->render($content);
56  return $content;
57  }
58 
59  protected function renderXHtmlHead()
60  {
61  $themeName = Yii::app()->theme->name;
62  $themeBaseUrl = Yii::app()->getRequest()->getHostInfo() .
63  Yii::app()->themeManager->baseUrl . '/' . $themeName;
64  $cs = Yii::app()->getClientScript();
65  $specialCssContent = null;
66  $publishedAssetsPath = Yii::app()->getRequest()->getHostInfo() . Yii::app()->assetManager->publish(
67  Yii::getPathOfAlias("application.core.views.assets.fonts"));
68  $specialCssContent .= "<style>" .
69  "@font-face" .
70  "{" .
71  "font-family: 'zurmo_gamification_symbly_rRg';" .
72  "src: url('{$publishedAssetsPath}/zurmogamificationsymblyregular-regular-webfont.eot');" .
73  "src: url('{$publishedAssetsPath}/zurmogamificationsymblyregular-regular-webfont.eot?#iefix') format('embedded-opentype'), " .
74  "url('{$publishedAssetsPath}/zurmogamificationsymblyregular-regular-webfont.woff') format('woff'), " .
75  "url('{$publishedAssetsPath}/zurmogamificationsymblyregular-regular-webfont.ttf') format('truetype'), " .
76  "url('{$publishedAssetsPath}/zurmogamificationsymblyregular-regular-webfont.svg#zurmo_gamification_symbly_rRg') format('svg');" .
77  "font-weight: normal;" .
78  "font-style: normal;" .
79  "unicode-range: U+00-FFFF;" . // Not Coding Standard
80  "}" .
81  "</style>";
82  if (!MINIFY_SCRIPTS && Yii::app()->isApplicationInstalled())
83  {
84  $specialCssContent .= '<link rel="stylesheet/less" type="text/css" id="default-theme" href="' .
85  $themeBaseUrl . '/less/default-theme.less"/>';
86  if (Yii::app()->userInterface->isMobile())
87  {
88  $specialCssContent .= '<link rel="stylesheet/less" type="text/css" id="mobile" href="' .
89  $themeBaseUrl . '/less/mobile.less"/>';
90  }
91  $specialCssContent .= '<!--[if lt IE 9]><link rel="stylesheet/less" type="text/css" href="' .
92  $themeBaseUrl . '/less/ie.less"/><![endif]-->';
93  }
94  else
95  {
96  Yii::app()->themeManager->registerThemeColorCss();
97  if (file_exists("themes/$themeName/css/commercial.css"))
98  {
99  $cs->registerCssFile($themeBaseUrl . '/css/commercial.css' .
100  ZurmoAssetManager::getCssAndJavascriptHashQueryString("themes/$themeName/css/commercial.css"));
101  }
102  if (file_exists("themes/$themeName/css/custom.css"))
103  {
104  $cs->registerCssFile($themeBaseUrl . '/css/custom.css' .
105  ZurmoAssetManager::getCssAndJavascriptHashQueryString("themes/$themeName/css/custom.css"));
106  }
107  // https://www.pivotaltracker.com/story/show/82070424
108  /*if (Yii::app()->userInterface->isMobile())
109  {
110  $cs->registerCssFile($themeBaseUrl . '/css/mobile.css');
111  }
112  */
113  if (Yii::app()->getRequest()->isContextiveExternalRequest())
114  {
115  $cs->registerCssFile($themeBaseUrl . '/css/gmail.css' .
116  ZurmoAssetManager::getCssAndJavascriptHashQueryString("themes/$themeName/css/gmail.css"));
117  }
118  if (Yii::app()->getClientScript()->isIsolationMode())
119  {
120  $cs->registerCssFile($themeBaseUrl . '/css/webforms-external.css' .
121  ZurmoAssetManager::getCssAndJavascriptHashQueryString("themes/$themeName/css/webforms-external.css"));
122  }
123  }
124  if (MINIFY_SCRIPTS)
125  {
126  Yii::app()->minScript->generateScriptMap('css');
127  Yii::app()->minScript->generateScriptMap('css-color');
128  }
129  if (Yii::app()->browser->getName() == 'msie' && Yii::app()->browser->getVersion() < 9)
130  {
131  $cs->registerCssFile($themeBaseUrl . '/css/ie.css' .
132  ZurmoAssetManager::getCssAndJavascriptHashQueryString("themes/$themeName/css/ie.css"), 'screen, projection');
133  }
134 
135  foreach ($this->getStyles() as $style)
136  {
137  if ($style != 'ie')
138  {
139  if (file_exists("themes/$themeName/css/$style.css"))
140  {
141  // Begin Not Coding Standard
142  $cs->registerCssFile($themeBaseUrl . '/css/' . $style. '.css' .
143  ZurmoAssetManager::getCssAndJavascriptHashQueryString("themes/$themeName/css/$style.css")); // Not Coding Standard
144  // End Not Coding Standard
145  }
146  }
147  }
148  return '<head>' . $specialCssContent . '</head>';
149  }
150 
151  public static function registerExternalPageScriptFiles()
152  {
153  if (!MINIFY_SCRIPTS && Yii::app()->isApplicationInstalled())
154  {
155  Yii::app()->clientScript->registerScriptFile(
156  Yii::app()->getAssetManager()->publish(
157  Yii::getPathOfAlias('application.core.views.assets')) . '/less-1.2.0.min.js');
158  }
159  Yii::app()->clientScript->registerScriptFile(
160  Yii::app()->getAssetManager()->publish(
161  Yii::getPathOfAlias('application.core.views.assets')) . '/interactions.js');
162  Yii::app()->clientScript->registerScriptFile(
163  Yii::app()->getAssetManager()->publish(
164  Yii::getPathOfAlias('application.core.views.assets')) . '/jquery.truncateText.js');
165  }
166  }
167 ?>
Definition: View.php:43
static getCssAndJavascriptHashQueryString($filePath)
renderXHtmlBodyStart()
Definition: PageView.php:336
renderXHtmlBodyEnd()
Definition: PageView.php:354
render()
Definition: View.php:83
Generated on Wed Jul 8 2020 07:10:39
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.