/** * Generates the necessary URL parameters for the download/view page. * * @param Horde_Mime_Part $mime_part The MIME part to view. * @param integer $actionID The actionID to perform. * @param array $params Additional parameters to pass. * * @return array The array of parameters. */ protected function _urlViewParams($mime_part, $actionID, $params) { /* Add the necessary local parameters. */ $params = array_merge($params, array('actionID' => $actionID, 'id' => isset($params['id']) ? $params['id'] : $mime_part->getMIMEId())); if ($this->_indices) { $params['muid'] = strval($this->getIndicesOb()); } return IMP_Contents_View::addToken($params); }
/** * Add base javascript variables to the page. */ protected function _addBaseVars() { global $prefs, $registry; /* Variables used in core javascript files. */ $this->js_conf = array_filter(array('URI_COMPOSE' => strval(IMP_Dynamic_Compose::url()->setRaw(true)), 'URI_MAILLOG' => strval(IMP_Dynamic_Maillog::url()->setRaw(true)), 'URI_VIEW' => strval(Horde::url('view.php')->add(IMP_Contents_View::addToken())), 'disable_compose' => !IMP_Compose::canCompose(), 'pref_prefix' => hash(version_compare(PHP_VERSION, '5.4', '>=') ? 'fnv132' : 'sha1', $registry->getAuth() . '|' . $_SERVER['SERVER_NAME']))); /* Context menu definitions. * Keys: * - Begin with '_mbox': A mailbox name container entry * - Begin with '_sep': A separator * - Begin with '_sub': All subitems wrapped in a DIV * - Begin with a '*': No icon */ $context = array('ctx_contacts' => array('_sub1' => new stdClass(), 'new' => _("New Message"), 'add' => _("Add to Address Book"), 'copy' => _("Copy to Clipboard")), 'ctx_reply' => array('reply' => _("To Sender"), 'reply_all' => _("To All"), 'reply_list' => _("To List"))); if ($registry->hasLink('mail/newEmailFilter')) { $context['ctx_contacts']['addfilter'] = _("Create Filter"); } /* Forward context menu. */ $context['ctx_forward'] = array('attach' => _("As Attachment"), 'body' => _("In Body Text"), 'both' => _("Attachment and Body Text"), '_sep1' => null, 'editasnew' => _("Edit as New"), '_sep2' => null, 'redirect' => _("Redirect")); if ($prefs->isLocked('forward_default')) { unset($context['ctx_forward']['attach'], $context['ctx_forward']['body'], $context['ctx_forward']['both'], $context['ctx_forward']['_sep1']); } $this->js_context = $context; /* Gettext strings used in core javascript files. */ $this->js_text = array('emailcopy' => _("Your browser security settings don't permit direct access to the clipboard.") . "\n" . _("You need to either use the keyboard (Ctrl/Cmd + C) or right click on the selected address to access the Copy command."), 'resent' => _("Resent on %s by:"), 'strip_warn' => _("Are you sure you wish to PERMANENTLY delete this attachment?"), 'verify' => _("Verifying...")); }