public static function inlinescripts() { $t = \GO::config()->get_setting('login_screen_text_enabled'); if (!empty($t)) { $login_screen_text = \GO::config()->get_setting('login_screen_text'); $login_screen_text_title = \GO::config()->get_setting('login_screen_text_title'); echo 'GO.mainLayout.on("login", function(mainLayout){mainLayout.msg("' . \GO\Base\Util\String::escape_javascript($login_screen_text_title) . '", "' . \GO\Base\Util\String::escape_javascript($login_screen_text) . '", 3600, 400);});'; } }
<?php $GO_SCRIPTS_JS .= 'GO.addressbook.lang.defaultSalutationExpression="' . \GO\Base\Util\String::escape_javascript(\GO::t('defaultSalutation', 'addressbook')) . '";'; $export_acl_id = \GO::config()->get_setting('go_addressbook_export', 0); if (!$export_acl_id) { $acl = new \GO\Base\Model\Acl(); $acl->description = 'addressbook_export'; $acl->save(); $export_acl_id = $acl->id; \GO::config()->save_setting('go_addressbook_export', $acl->id, 0); } $GO_SCRIPTS_JS .= 'GO.addressbook.export_acl_id="' . $export_acl_id . '";'; $acl_level = \GO\Base\Model\Acl::getUserPermissionLevel($export_acl_id, \GO::user()->id); $GO_SCRIPTS_JS .= 'GO.addressbook.exportPermission="' . ($acl_level ? 1 : 0) . '";'; if (\GO::modules()->customfields) { $GO_SCRIPTS_JS .= ' GO.customfields.settingsPanels={ name: "' . \GO\Addressbook\Model\Contact::model()->localizedName . '", panels: [] };' . "\n"; $stmt = \GO\Users\Model\CfSettingTab::model()->getSettingTabs(); while ($category = $stmt->fetch()) { $fields = array(); $fstmt = $category->fields(); while ($field = $fstmt->fetch()) { $fields[] = $field->toJsonArray(); } // Makes global, client-side, editable form panels for every customfield category $GO_SCRIPTS_JS .= "\n\n" . 'GO.customfields.settingsPanels.panels.push({xtype : "customformpanel", itemId:"cf-panel-' . $category->id . '", category_id: ' . $category->id . ', title : "' . htmlspecialchars($category->name, ENT_QUOTES, 'UTF-8') . '", customfields : ' . json_encode($fields) . '});' . "\n"; }
public function actionView($params) { // Do not close session writing because SMIME stores the password in the session // GO::session()->closeWriting(); $params['no_max_body_size'] = !empty($params['no_max_body_size']) && $params['no_max_body_size'] !== 'false' ? true : false; $account = Account::model()->findByPk($params['account_id']); if (!$account) { throw new \GO\Base\Exception\NotFound(); } $imapMessage = \GO\Email\Model\ImapMessage::model()->findByUid($account, $params['mailbox'], $params['uid']); if (!$imapMessage) { throw new \GO\Base\Exception\NotFound(); } //workaround for gmail. It doesn't flag messages as seen automatically. // if (!$imapMessage->seen && stripos($account->host, 'gmail') !== false) // $imapMessage->getImapConnection()->set_message_flag(array($imapMessage->uid), "\Seen"); if (!empty($params['create_temporary_attachments'])) { $imapMessage->createTempFilesForAttachments(); } $plaintext = !empty($params['plaintext']); $response = $imapMessage->toOutputArray(!$plaintext, false, $params['no_max_body_size']); $response['uid'] = intval($params['uid']); $response['mailbox'] = $params['mailbox']; $response['account_id'] = intval($params['account_id']); $response['do_not_mark_as_read'] = $account->do_not_mark_as_read; if (!$plaintext) { if ($params['mailbox'] != $account->sent && $params['mailbox'] != $account->drafts) { $response = $this->_blockImages($params, $response); $response = $this->_checkXSS($params, $response); } //Don't do these special actions in the special folders if ($params['mailbox'] != $account->sent && $params['mailbox'] != $account->trash && $params['mailbox'] != $account->drafts) { $linkedModels = $this->_handleAutoLinkTag($imapMessage, $response); $response = $this->_handleInvitations($imapMessage, $params, $response); $linkedModels = $this->_handleAutoContactLinkFromSender($imapMessage, $linkedModels); // Process found autolink tags if (count($linkedModels) > 0) { $linkedItems = ''; foreach ($linkedModels as $linkedModel) { $searchModel = \GO\Base\Model\SearchCacheRecord::model()->findByPk(array('model_id' => $linkedModel->pk, 'model_type_id' => $linkedModel->modelTypeId()), false, true); if ($searchModel) { $linkedItems .= ', <span class="em-autolink-link" onclick="GO.linkHandlers[\'' . \GO\Base\Util\String::escape_javascript($linkedModel->className()) . '\'].call(this, ' . $linkedModel->id . ');">' . $searchModel->name . ' (' . $linkedModel->localizedName . ')</span>'; } } $linkedItems = trim($linkedItems, ' ,'); $response['htmlbody'] = '<div class="em-autolink-message">' . sprintf(GO::t('autolinked', 'email'), $linkedItems) . '</div>' . $response['htmlbody']; } } } $response['isInSpamFolder'] = $this->_getSpamMoveMailboxName($params['uid'], $params['mailbox'], $account->id); $response = $this->_getContactInfo($imapMessage, $params, $response); $this->fireEvent('view', array(&$this, &$response, $imapMessage, $account, $params)); $response['success'] = true; return $response; }
auto_list_rooms: true, //auto_subscribe: true, debug: false, hide_muc_server: true, i18n: locales["' . GO::language()->getLanguage() . '"], // Refer to ./locale/locales.js to see which locales are supported show_controlbox_by_default: true, xhr_user_search: false, jid: "' . GO::user()->username . '@puan.ddns.net", password: "******", //fullname: "' . GO::user()->name . '" allow_registration: false }); var name = converseJs.select("input.new-chatroom-name"); name.value="conference.' . \GO\Chat\ChatModule::getXmppHost() . '"; var nick = converseJs.select("input.new-chatroom-nick"); nick.value="' . \GO\Base\Util\String::escape_javascript(GO::user()->name) . '"; }); ';
GO.customfields.types["' . String::escape_javascript($model->extendsModel()) . '"]={ name: "' . \GO::getModel($model->extendsModel())->localizedName . '", panels: [] };' . "\n"; $stmt = \GO\Customfields\Model\Category::model()->findByModel($model->extendsModel()); while ($category = $stmt->fetch()) { $fields = array(); $fstmt = $category->fields(); while ($field = $fstmt->fetch()) { $fields[] = $field->toJsonArray(); } // Makes global, client-side, editable form panels for every customfield category if ($category->checkPermissionLevel(\GO\Base\Model\Acl::WRITE_PERMISSION)) { $GO_SCRIPTS_JS .= "\n\n" . 'GO.customfields.types["' . String::escape_javascript($model->extendsModel()) . '"].panels.push({xtype : "customformpanel", itemId:"cf-panel-' . $category->id . '", category_id: ' . $category->id . ', title : "' . htmlspecialchars($category->name, ENT_QUOTES, 'UTF-8') . '", customfields : ' . json_encode($fields) . '});' . "\n"; } /** * Registers customfield column information in a global, client-side object, ordered by model. * Also, this loop ensures that every customfield data being used has such information * described in a global, client-side object, ordered by customfield id. */ foreach ($fields as $field) { $align = $field['datatype'] == 'GO\\Customfields\\Customfieldtype\\Number' || $field['datatype'] == 'GO\\Customfields\\Customfieldtype\\Date' || $field['datatype'] == 'GO\\Customfields\\Customfieldtype\\Datetime' ? 'right' : 'left'; $exclude_from_grid = $field['exclude_from_grid'] || $field['datatype'] == 'GO\\Customfields\\Customfieldtype\\Heading' ? 'true' : 'false'; $GO_SCRIPTS_JS .= 'GO.customfields.columns["' . String::escape_javascript($model->extendsModel()) . '"].push({' . 'header: "' . \GO\Base\Util\String::escape_javascript($field['name']) . '",' . 'dataIndex: "' . $field['dataname'] . '" ,' . 'datatype:"' . \GO\Base\Util\String::escape_javascript($field['datatype']) . '", ' . 'align:"' . $align . '", ' . 'sortable:true,' . 'id: "' . $field['dataname'] . '",' . 'customfield_id: "' . $field['id'] . '",' . 'nesting_level: "' . $field['nesting_level'] . '",' . 'exclude_from_grid: "' . $exclude_from_grid . '",' . 'hidden:true});' . "\n" . 'GO.customfields.columnMap["' . $field['dataname'] . '"]=GO.customfields.columns["' . String::escape_javascript($model->extendsModel()) . '"][GO.customfields.columns["' . String::escape_javascript($model->extendsModel()) . '"].length-1];' . "\n"; } } } } } }
<?php $findParams = \GO\Base\Db\FindParams::newInstance()->criteria(\GO\Base\Db\FindCriteria::newInstance()->addCondition('behave_as_module', 1)); $stmt = \GO\Bookmarks\Model\Bookmark::model()->find($findParams); while ($bookmark = $stmt->fetch()) { if (strlen($bookmark->name) > 30) { $name = substr($bookmark->name, 0, 28) . '..'; } else { $name = $bookmark->name; } $GO_SCRIPTS_JS .= 'GO.moduleManager.addModule(\'bookmarks-id-' . $bookmark->id . '\', GO.panel.IFrameComponent, {title : \'' . \GO\Base\Util\String::escape_javascript($name) . '\', url : \'' . \GO\Base\Util\String::escape_javascript($bookmark->content) . '\',iconCls: \'go-tab-icon-bookmarks\'});'; } // Load the bookmark categories for the start menu $categoryFindParams = \GO\Base\Db\FindParams::newInstance()->criteria(\GO\Base\Db\FindCriteria::newInstance()->addCondition('show_in_startmenu', 1)); $categoryStmt = \GO\Bookmarks\Model\Category::model()->find($categoryFindParams); while ($category = $categoryStmt->fetch()) { if (strlen($category->name) > 30) { $categoryName = substr($category->name, 0, 28) . '..'; } else { $categoryName = $category->name; } $bookmarks = $category->bookmarks; while ($bookmark = $bookmarks->fetch()) { if (strlen($bookmark->name) > 30) { $name = substr($bookmark->name, 0, 28) . '..'; } else { $name = $bookmark->name; } $GO_SCRIPTS_JS .= 'GO.moduleManager.addModule(\'bookmarks-id-' . $bookmark->id . '\', GO.panel.IFrameComponent, {title : \'' . \GO\Base\Util\String::escape_javascript($name) . '\', url : \'' . \GO\Base\Util\String::escape_javascript($bookmark->content) . '\',iconCls: \'go-tab-icon-bookmarks\'},{title:\'' . \GO\Base\Util\String::escape_javascript($categoryName) . '\',iconCls: \'go-menu-icon-bookmarks\'});'; } }