* This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * 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". *****************************************************************************************/ /* Public/private profile page. If the requested profile belongs to the current user, profile widgets get displayed in addition to the activity feed/profile information sections. */ Yii::app()->clientScript->registerCssFiles('profileCombinedCss', array('profile.css', 'activityFeed.css', '../../../js/multiselect/css/ui.multiselect.css')); Yii::app()->clientScript->registerResponsiveCssFile(Yii::app()->getTheme()->getBaseUrl() . '/css/responsiveActivityFeed.css'); AuxLib::registerPassVarsToClientScriptScript('x2.profile', array('isMyProfile' => $isMyProfile ? 'true' : 'false'), 'profileScript'); $this->renderPartial('_activityFeed', array('dataProvider' => $dataProvider, 'profileId' => $model->id, 'users' => $users, 'lastEventId' => $lastEventId, 'firstEventId' => $firstEventId, 'lastTimestamp' => $lastTimestamp, 'stickyDataProvider' => $stickyDataProvider, 'userModels' => $userModels, 'isMyProfile' => $isMyProfile));
/** * Performs all the necessary JavaScript/CSS initializations for most parts of the app. */ public function registerMain() { foreach (array('IS_IPAD', 'RESPONSIVE_LAYOUT') as $layoutConst) { defined($layoutConst) or define($layoutConst, false); } $fullscreen = $this->fullscreen; $profile = $this->profile; $baseUrl = $this->baseUrl; $themeUrl = $this->themeUrl; $scriptUrl = $this->scriptUrl; $admin = $this->admin; $isGuest = $this->isGuest; // jQuery and jQuery UI libraries $this->registerCoreScript('jquery')->registerCoreScript('jquery.ui')->registerCoreScript('jquery.migrate')->registerCoreScript('bbq'); $this->registerPackages($this->getDefaultPackages()); $cldScript = $this->getCurrencyConfigScript(); AuxLib::registerPassVarsToClientScriptScript('auxlib', array('saveMiscLayoutSettingUrl' => "'" . addslashes(Yii::app()->createUrl('/profile/saveMiscLayoutSetting')) . "'"), 'passAuxLibVars'); $this->registerX2ModelMappingsScript(); $this->registerX2Forms(); $this->registerX2QuickCRUD(); $this->registerX2Flashes(); Yii::app()->clientScript->registerScript('csrfTokenScript', "\n x2.csrfToken = '" . Yii::app()->request->getCsrfToken() . "';\n ", CClientScript::POS_HEAD); $this->registerAttachments(); $this->registerDateFormats(); if (YII_DEBUG) { $this->registerScriptFile($baseUrl . '/js/Timer.js'); } Yii::app()->clientScript->registerPackage('spectrum'); // custom scripts $this->registerScriptFile($baseUrl . '/js/json2.js')->registerScriptFile($baseUrl . '/js/webtoolkit.sha256.js')->registerScriptFile($baseUrl . '/js/main.js', CCLientScript::POS_HEAD)->registerScriptFile($baseUrl . '/js/auxlib.js', CClientScript::POS_HEAD)->registerScriptFile($baseUrl . '/js/IframeFixOverlay.js', CClientScript::POS_HEAD)->registerScriptFile($baseUrl . '/js/LayoutManager.js')->registerScriptFile($baseUrl . '/js/media.js')->registerScript('formatCurrency-locales', $cldScript, CCLientScript::POS_HEAD)->registerScriptFile($baseUrl . '/js/modernizr.custom.66175.js')->registerScriptFile($baseUrl . '/js/widgets.js')->registerScriptFile($baseUrl . '/js/qtip/jquery.qtip.min.js')->registerScriptFile($baseUrl . '/js/ActionFrames.js')->registerScriptFile($baseUrl . '/js/ColorPicker.js', CCLientScript::POS_END)->registerScriptFile($baseUrl . '/js/PopupDropdownMenu.js', CCLientScript::POS_END)->registerScriptFile($baseUrl . '/js/jQueryOverrides.js', CCLientScript::POS_END)->registerScriptFile($baseUrl . '/js/checklistDropdown/jquery.multiselect.js'); $this->registerTestingScripts(); $this->registerDebuggingScripts(); if (IS_IPAD) { $this->registerScriptFile($baseUrl . '/js/jquery.mobile.custom.js'); } $this->registerInitScript(); $this->registerAuxLibTranslationsScript(); if (Yii::app()->session['translate']) { $this->registerScriptFile($baseUrl . '/js/translator.js'); } $this->registerScriptFile($baseUrl . '/js/backgroundFade.js'); $this->registerScript('datepickerLanguage', "\n \$.datepicker.setDefaults(\$.datepicker.regional['']);\n "); $mmPath = Yii::getPathOfAlias('application.extensions.moneymask.assets'); $aMmPath = Yii::app()->getAssetManager()->publish($mmPath); $this->registerScriptFile("{$aMmPath}/jquery.maskMoney.js"); $this->registerCssFile($baseUrl . '/css/normalize.css', 'all')->registerCssFile($themeUrl . '/css/print.css', 'print')->registerCoreScript('cookie'); $this->registerCombinedCss(); if (!RESPONSIVE_LAYOUT && IS_ANDROID) { $this->registerCssFile($themeUrl . '/css/androidLayout.css', 'screen, projection'); } elseif (IS_IPAD) { $this->registerCssFile($themeUrl . '/css/ipadLayout.css', 'screen, projection'); } $this->registerScript('fullscreenToggle', ' window.enableFullWidth = ' . (!Yii::app()->user->isGuest ? $profile->enableFullWidth ? 'true' : 'false' : 'true') . '; window.fullscreen = ' . ($fullscreen ? 'true' : 'false') . '; ', CClientScript::POS_HEAD); if (is_object(Yii::app()->controller->module)) { $this->registerScript('saveCurrModule', "\n x2.currModule = '" . Yii::app()->controller->module->name . "';\n ", CClientScript::POS_HEAD); } if (!$isGuest) { $this->registerScript('notificationsParams', "\n x2.notifications = new x2.Notifs ({\n disablePopup: " . ($profile->disableNotifPopup ? 'true' : 'false') . ",\n translations: {\n clearAll: '" . addslashes(Yii::t('app', 'Permanently delete all notifications?')) . "'\n }\n });\n ", CClientScript::POS_READY); $this->registerScriptFile($baseUrl . '/js/jstorage.min.js')->registerScriptFile($baseUrl . '/js/notifications.js', CClientScript::POS_BEGIN); } if (!$isGuest && ($profile->language == 'he' || $profile->language == 'fa')) { $this->registerCss('rtl-language', 'body{text-align:right;}'); } $this->registerCoreScript('rating'); }