Skip to content

Commit

Permalink
More stuff to remove relating to basic view
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Oct 16, 2014
1 parent a569e6c commit 422109b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 97 deletions.
8 changes: 0 additions & 8 deletions imp/lib/Ajax/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@ protected function _init()

switch ($registry->getView()) {
case $registry::VIEW_BASIC:
$this->addHandler('IMP_Ajax_Application_Handler_Mboxtoggle');
$this->addHandler('IMP_Ajax_Application_Handler_Passphrase');
$this->addHandler('IMP_Ajax_Application_Handler_Search');
if ($injector->getInstance('IMP_Factory_Imap')->create()->access(IMP_Imap::ACCESS_REMOTE)) {
$this->addHandler('IMP_Ajax_Application_Handler_RemotePrefs');
}
break;

case $registry::VIEW_DYNAMIC:
$this->addHandler('IMP_Ajax_Application_Handler_Common');
$this->addHandler('IMP_Ajax_Application_Handler_ComposeAttach');
Expand Down
41 changes: 5 additions & 36 deletions imp/lib/Basic/Thread.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,6 @@ protected function _init()
break;
}

switch ($registry->getView()) {
case $registry::VIEW_BASIC:
$curr_msg['link'] .= ' | ' . Horde::widget(array('url' => $this->indices->mailbox->url('message', $idx), 'title' => _("Go to Message"), 'nocheck' => true)) .
' | ' . Horde::widget(array('url' => $this->indices->mailbox->url('mailbox')->add(array('start' => $imp_mailbox->getArrayIndex($idx))), 'title' => sprintf(_("Bac_k to %s"), $page_label)));
break;
}

$curr_tree['subject'] .= Horde::link('#i' . $idx) . Horde_String::truncate($subject_header, 60) . '</a> (' . $addr . ')';

$msgs[] = $curr_msg;
Expand All @@ -161,22 +154,6 @@ protected function _init()
if ($mode == 'thread') {
$view->subject = $subject;
$view->thread = true;

switch ($registry->getView()) {
case $registry::VIEW_BASIC:
$uid_list = $imp_indices[strval($this->indices->mailbox)];
$delete_link = $this->indices->mailbox->url('mailbox')->add(array(
'actionID' => 'delete_messages',
'indices' => strval($imp_indices),
'token' => $session->getToken(),
'start' => $imp_mailbox->getArrayIndex(end($uid_list))
));
$view->delete = Horde::link($delete_link, _("Delete Thread"), null, null, null, null, null, array('id' => 'threaddelete'));
$page_output->addInlineScript(array(
'$("threaddelete").observe("click", function(e) { if (!window.confirm(' . json_encode(_("Are you sure you want to delete all messages in this thread?")) . ')) { e.stop(); } })'
), true);
break;
}
} else {
$view->subject = sprintf(_("%d Messages"), count($msgs));
}
Expand All @@ -189,14 +166,10 @@ protected function _init()

$this->output = $view->render('thread');

switch ($registry->getView()) {
case $registry::VIEW_DYNAMIC:
$page_output->topbar = $page_output->sidebar = false;
$this->header_params = array(
'html_id' => 'htmlAllowScroll'
);
break;
}
$page_output->topbar = $page_output->sidebar = false;
$this->header_params = array(
'html_id' => 'htmlAllowScroll'
);

$this->title = ($mode == 'thread')
? _("Thread View")
Expand All @@ -207,11 +180,7 @@ protected function _init()
*/
public function status()
{
global $registry;

return ($registry->getView() == $registry::VIEW_DYNAMIC)
? ''
: parent::status();
return '';
}

/**
Expand Down
15 changes: 4 additions & 11 deletions imp/lib/Compose/Ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,13 @@ public function attachSpellChecker()
return true;
}

if ($registry->getView() == Horde_Registry::VIEW_BASIC) {
$spell_img = '<span class="iconImg spellcheckImg"></span>';
$br = '<br />';
} else {
$spell_img = $br = '';
}

$injector->getInstance('Horde_Core_Factory_Imple')->create('SpellChecker', array(
'id' => 'spellcheck',
'states' => array(
'CheckSpelling' => $spell_img . $br . _("Check Spelling"),
'Checking' => $spell_img . $br . _("Checking..."),
'Error' => $spell_img . $br . _("Spell Check Failed"),
'ResumeEdit' => $spell_img . $br . _("Resume Editing")
'CheckSpelling' => _("Check Spelling"),
'Checking' => _("Checking..."),
'Error' => _("Spell Check Failed"),
'ResumeEdit' => _("Resume Editing")
),
'targetId' => 'composeMessage'
));
Expand Down
5 changes: 0 additions & 5 deletions imp/lib/IMP.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,6 @@ public static function getInitialPage()

switch ($registry->getView()) {
case Horde_Registry::VIEW_BASIC:
$result->url = is_null($mbox)
? IMP_Basic_Folders::url()
: $mbox->url('mailbox');
break;

case Horde_Registry::VIEW_DYNAMIC:
$result->url = IMP_Dynamic_Mailbox::url(array(
'mailbox' => is_null($mbox) ? 'INBOX' : $mbox
Expand Down
12 changes: 2 additions & 10 deletions imp/lib/Mime/Viewer/Pgp.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ protected function _outputPGPKey()
*/
protected function _outputPGPSigned()
{
global $conf, $injector, $prefs, $registry, $session;
global $conf, $injector, $prefs, $session;

$partlist = array_keys($this->_mimepart->contentTypeMap());
$base_id = reset($partlist);
Expand Down Expand Up @@ -467,15 +467,7 @@ protected function _outputPGPSigned()
)));
$ret[$base_id]['status'][] = $status2;
} else {
switch ($registry->getView()) {
case Horde_Registry::VIEW_BASIC:
$status->addText(Horde::link(Horde::selfUrlParams()->add(array('pgp_verify_msg' => 1))) . _("Click HERE to verify the message.") . '</a>');
break;

case Horde_Registry::VIEW_DYNAMIC:
$status->addText(Horde::link('#', '', 'pgpVerifyMsg') . _("Click HERE to verify the message.") . '</a>');
break;
}
$status->addText(Horde::link('#', '', 'pgpVerifyMsg') . _("Click HERE to verify the message.") . '</a>');
}

return $ret;
Expand Down
10 changes: 1 addition & 9 deletions imp/lib/Mime/Viewer/Smime.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,7 @@ protected function _parseSignedData($sig_only = false)
$status->addText($e->getMessage());
}
} else {
switch ($GLOBALS['registry']->getView()) {
case Horde_Registry::VIEW_BASIC:
$status->addText(Horde::link(Horde::selfUrlParams()->add('smime_verify_msg', 1)) . _("Click HERE to verify the data.") . '</a>');
break;

case Horde_Registry::VIEW_DYNAMIC:
$status->addText(Horde::link('#', '', 'smimeVerifyMsg') . _("Click HERE to verify the data.") . '</a>');
break;
}
$status->addText(Horde::link('#', '', 'smimeVerifyMsg') . _("Click HERE to verify the data.") . '</a>');
}

if ($sig_only) {
Expand Down
25 changes: 7 additions & 18 deletions imp/lib/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class IMP_Search implements ArrayAccess, IteratorAggregate, Serializable
const MBOX_PREFIX = "impsearch\0";

/* The special search mailbox names. */
const BASIC_SEARCH = 'impbsearch';
const DIMP_FILTERSEARCH = 'dimpfsearch';
const DIMP_QUICKSEARCH = 'dimpqsearch';

Expand Down Expand Up @@ -377,7 +376,7 @@ public function isQuery($id, $editable = false)
public function isSystemQuery($id)
{
return (isset($this->_search['query'][$this->_strip($id)]) &&
in_array($this[$id]->id, array(self::BASIC_SEARCH, self::DIMP_FILTERSEARCH, self::DIMP_QUICKSEARCH)));
in_array($this[$id]->id, array(self::DIMP_FILTERSEARCH, self::DIMP_QUICKSEARCH)));
}

/**
Expand All @@ -389,24 +388,14 @@ public function isSystemQuery($id)
*/
public function editUrl($id)
{
global $registry;

$mbox = IMP_Mailbox::get($this->createSearchId($id));

switch ($registry->getView()) {
case $registry::VIEW_BASIC:
return $mbox->url(IMP_Basic_Search::url())->add(array(
'edit_query' => 1
));

case $registry::VIEW_DYNAMIC:
return IMP_Dynamic_Mailbox::url()->setAnchor(
'search:' . json_encode(array(
'edit_query' => 1,
'mailbox' => $mbox->form_to
))
);
}
return IMP_Dynamic_Mailbox::url()->setAnchor(
'search:' . json_encode(array(
'edit_query' => 1,
'mailbox' => $mbox->form_to
))
);
}

/**
Expand Down

0 comments on commit 422109b

Please sign in to comment.