Skip to content

Commit

Permalink
[mms] Removed minimal view.
Browse files Browse the repository at this point in the history
For now, treat minimal view as smartmobile view
  • Loading branch information
slusarz committed Oct 10, 2014
1 parent 23ebd86 commit 1707431
Show file tree
Hide file tree
Showing 47 changed files with 40 additions and 2,085 deletions.
1 change: 1 addition & 0 deletions imp/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v6.3.0-git
----------

[mms] Removed minimal view.
[mms] Allow auto-completed e-mail groups to be expanded on the dynamic compose
page.
[mms] Add class of message part rendering display errors that aren't show to
Expand Down
5 changes: 4 additions & 1 deletion imp/docs/UPGRADING
Expand Up @@ -42,9 +42,12 @@ Administration => Configuration and update anything that's highlighted as
outdated.


Upgrading IMP From 6.2.x To x.x
Upgrading IMP From 6.2.x To 7.x
===============================

The minimal view has been removed.


Configuration Options (conf.php)
--------------------------------

Expand Down
1 change: 1 addition & 0 deletions imp/lib/Ajax/Application.php
Expand Up @@ -78,6 +78,7 @@ protected function _init()
}
break;

case $registry::VIEW_MINIMAL:
case $registry::VIEW_SMARTMOBILE:
$this->addHandler('IMP_Ajax_Application_Handler_Common');
$this->addHandler('IMP_Ajax_Application_Handler_ComposeAttach');
Expand Down
1 change: 1 addition & 0 deletions imp/lib/Ajax/Application/ShowMessage.php
Expand Up @@ -256,6 +256,7 @@ public function showMessage($args)
$show_parts = $prefs->getValue('parts_display');

switch ($registry->getView()) {
case $registry::VIEW_MINIMAL:
case $registry::VIEW_SMARTMOBILE:
$contents_mask = 0;
break;
Expand Down
1 change: 1 addition & 0 deletions imp/lib/Ajax/Queue.php
Expand Up @@ -220,6 +220,7 @@ public function add(IMP_Ajax_Application $ajax)
/* Add flag configuration. */
switch ($this->_flagconfig) {
case Horde_Registry::VIEW_DYNAMIC:
case Horde_Registry::VIEW_MINIMAL:
case Horde_Registry::VIEW_SMARTMOBILE:
$flags = array();
foreach ($injector->getInstance('IMP_Flags')->getList() as $val) {
Expand Down
2 changes: 0 additions & 2 deletions imp/lib/Application.php
Expand Up @@ -44,7 +44,6 @@
*/
class IMP_Application extends Horde_Registry_Application
{

/**
*/
public $auth = array(
Expand All @@ -59,7 +58,6 @@ class IMP_Application extends Horde_Registry_Application
*/
public $features = array(
'dynamicView' => true,
'minimalView' => true,
'notificationHandler' => true,
'smartmobileView' => true
);
Expand Down
4 changes: 0 additions & 4 deletions imp/lib/Basic/Compose.php
Expand Up @@ -40,10 +40,6 @@ protected function _init()
case Horde_Registry::VIEW_DYNAMIC:
IMP_Dynamic_Compose::url()->add($_GET)->redirect();
exit;

case Horde_Registry::VIEW_MINIMAL:
IMP_Minimal_Compose::url()->add($_GET)->redirect();
exit;
}
}

Expand Down
7 changes: 2 additions & 5 deletions imp/lib/Compose/Link.php
Expand Up @@ -98,15 +98,12 @@ public function link($simplejs = false)
: IMP_Basic_Compose::url();
$raw = true;
$callback = array($this, 'composeLinkSimpleCallback');
} elseif (($view != Horde_Registry::VIEW_MINIMAL) &&
$prefs->getValue('compose_popup') &&
} elseif ($prefs->getValue('compose_popup') &&
$browser->hasFeature('javascript')) {
$url = IMP_Basic_Compose::url();
$callback = array($this, 'composeLinkJsCallback');
} else {
$url = ($view == Horde_Registry::VIEW_MINIMAL)
? IMP_Minimal_Compose::url()
: IMP_Basic_Compose::url();
$url = IMP_Basic_Compose::url();
}

if (isset($args['mailbox'])) {
Expand Down
1 change: 0 additions & 1 deletion imp/lib/Factory/PrefsSort.php
Expand Up @@ -30,7 +30,6 @@ class IMP_Factory_PrefsSort extends Horde_Core_Factory_Injector
public function create(Horde_Injector $injector)
{
switch ($GLOBALS['registry']->getView()) {
case Horde_Registry::VIEW_MINIMAL:
case Horde_Registry::VIEW_SMARTMOBILE:
return new IMP_Prefs_Sort_FixedDate();

Expand Down
12 changes: 0 additions & 12 deletions imp/lib/Flag/Base.php
Expand Up @@ -20,8 +20,6 @@
* @license http://www.horde.org/licenses/gpl GPL
* @package IMP
*
* @property-read string $abbreviation The abbreviation to use in the minimal
* view.
* @property string $bgcolor The background color.
* @property-read boolean $bgdefault Is the background color the default?
* @property-read boolean $canset Can this flag be set by the user?
Expand All @@ -42,13 +40,6 @@ abstract class IMP_Flag_Base implements Serializable
/* Default background color. */
const DEFAULT_BG = '#fff';

/**
* The abbreviation.
*
* @var string
*/
protected $_abbreviation = '';

/**
* The background color.
*
Expand Down Expand Up @@ -89,9 +80,6 @@ abstract class IMP_Flag_Base implements Serializable
public function __get($name)
{
switch ($name) {
case 'abbreviation':
return $this->_abbreviation;

case 'bgcolor':
return $this->_bgcolor
? $this->_bgcolor
Expand Down
4 changes: 0 additions & 4 deletions imp/lib/Flag/Imap/Deleted.php
Expand Up @@ -22,10 +22,6 @@
*/
class IMP_Flag_Imap_Deleted extends IMP_Flag_Imap
{
/**
*/
protected $_abbreviation = 'D';

/**
*/
protected $_bgcolor = '#999';
Expand Down
4 changes: 0 additions & 4 deletions imp/lib/Flag/Imap/Draft.php
Expand Up @@ -22,10 +22,6 @@
*/
class IMP_Flag_Imap_Draft extends IMP_Flag_Imap
{
/**
*/
protected $_abbreviation = 'd';

/**
*/
protected $_bgcolor = '#9fff25';
Expand Down
4 changes: 0 additions & 4 deletions imp/lib/Flag/Imap/Junk.php
Expand Up @@ -23,10 +23,6 @@
*/
class IMP_Flag_Imap_Junk extends IMP_Flag_Imap
{
/**
*/
protected $_abbreviation = 'J';

/**
*/
protected $_css = 'flagJunk';
Expand Down
4 changes: 0 additions & 4 deletions imp/lib/Flag/System/HighPriority.php
Expand Up @@ -22,10 +22,6 @@
*/
class IMP_Flag_System_HighPriority extends IMP_Flag_System_Match_Header
{
/**
*/
protected $_abbreviation = '!';

/**
*/
protected $_bgcolor = '#fcc';
Expand Down
4 changes: 0 additions & 4 deletions imp/lib/Flag/System/Unseen.php
Expand Up @@ -24,10 +24,6 @@
*/
class IMP_Flag_System_Unseen extends IMP_Flag_System_Match_Flag
{
/**
*/
protected $_abbreviation = 'U';

/**
*/
protected $_bgcolor = '#eef';
Expand Down
17 changes: 0 additions & 17 deletions imp/lib/Ftree.php
Expand Up @@ -1020,19 +1020,6 @@ public function createTree($name, array $opts = array())
$elt_parent = $this[self::BASE_ELT];
break;

case 'IMP_Tree_Simplehtml':
$is_open = $val->open;
if ($tree->shouldToggle($mbox_ob->form_to)) {
if ($is_open) {
$this->collapse($val);
} else {
$this->expand($val);
}
$is_open = !$is_open;
}
$label = htmlspecialchars(Horde_String::abbreviate($mbox_ob->abbrev_label, 30 - ($val->level * 2)));
break;

case 'Javascript':
$is_open = $val->open;
$label = empty($opts['basename'])
Expand Down Expand Up @@ -1064,10 +1051,6 @@ public function createTree($name, array $opts = array())
$params['container'] = true;
} else {
switch ($view) {
case $registry::VIEW_MINIMAL:
$params['url'] = IMP_Minimal_Mailbox::url(array('mailbox' => $mbox_ob));
break;

case $registry::VIEW_SMARTMOBILE:
$url = new Horde_Core_Smartmobile_Url();
$url->add('mbox', $mbox_ob->form_to);
Expand Down
5 changes: 0 additions & 5 deletions imp/lib/IMP.php
Expand Up @@ -177,11 +177,6 @@ public static function getInitialPage()
break;

case Horde_Registry::VIEW_MINIMAL:
$result->url = is_null($mbox)
? IMP_Minimal_Folders::url()
: IMP_Minimal_Mailbox::url(array('mailbox' => $mbox));
break;

case Horde_Registry::VIEW_SMARTMOBILE:
$result->url = is_null($mbox)
? Horde::url('smartmobile.php', true)
Expand Down
14 changes: 0 additions & 14 deletions imp/lib/Mailbox.php
Expand Up @@ -1179,20 +1179,6 @@ public function url($page, $buid = null, $encode = true)
return Horde::url('index.php')->setAnchor($anchor);

case Horde_Registry::VIEW_MINIMAL:
switch ($page) {
case 'message':
return IMP_Minimal_Message::url(array(
'buid' => $buid,
'mailbox' => $this->_mbox
))->setRaw(!$encode);

case 'mailbox':
return IMP_Minimal_Mailbox::url(array(
'mailbox' => $this->_mbox
))->setRaw(!$encode);
}
break;

case Horde_Registry::VIEW_SMARTMOBILE:
$url = Horde::url('smartmobile.php');
$anchor = is_null($buid)
Expand Down
25 changes: 7 additions & 18 deletions imp/lib/Message/Ui.php
Expand Up @@ -191,7 +191,6 @@ public function buildAddressLinks(Horde_Mail_Rfc822_List $addrlist,

$add_link = null;
$addr_array = array();
$minimal = ($registry->getView() == Horde_Registry::VIEW_MINIMAL);

/* Set up the add address icon link if contact manager is
* available. */
Expand All @@ -208,13 +207,11 @@ public function buildAddressLinks(Horde_Mail_Rfc822_List $addrlist,
if ($ob instanceof Horde_Mail_Rfc822_Group) {
$group_array = array();
foreach ($ob->addresses as $ad) {
$ret = $minimal
? strval($ad)
: htmlspecialchars(strval($ad));
$ret = htmlspecialchars(strval($ad));

if ($link) {
$clink = new IMP_Compose_Link(array('to' => strval($ad)));
$ret = Horde::link($clink->link(), sprintf(_("New Message to %s"), strval($ad))) . htmlspecialchars(strval($ad)) . '</a>';
$ret = Horde::link($clink->link(), sprintf(_("New Message to %s"), strval($ad))) . $ret . '</a>';
}

/* Append the add address icon to every address if contact
Expand All @@ -231,19 +228,15 @@ public function buildAddressLinks(Horde_Mail_Rfc822_List $addrlist,
$group_array[] = $ret;
}

$groupname = $minimal
? $ob->groupname
: htmlspecialchars($ob->groupname);

$addr_array[] = $groupname . ':' . (count($group_array) ? ' ' . implode(', ', $group_array) : '');
$addr_array[] = htmlspecialchars($ob->groupname) . ':' .
(count($group_array) ? ' ' .
implode(', ', $group_array) : '');
} else {
$ret = $minimal
? strval($ob)
: htmlspecialchars(strval($ob));
$ret = htmlspecialchars(strval($ob));

if ($link) {
$clink = new IMP_Compose_Link(array('to' => strval($ob)));
$ret = Horde::link($clink->link(), sprintf(_("New Message to %s"), strval($ob))) . htmlspecialchars(strval($ob)) . '</a>';
$ret = Horde::link($clink->link(), sprintf(_("New Message to %s"), strval($ob))) . $ret . '</a>';
}

/* Append the add address icon to every address if contact
Expand All @@ -261,10 +254,6 @@ public function buildAddressLinks(Horde_Mail_Rfc822_List $addrlist,
}
}

if ($minimal) {
return implode(', ', $addr_array);
}

/* If left with an empty address list ($ret), inform the user that the
* recipient list is purposely "undisclosed". */
if (empty($addr_array)) {
Expand Down
3 changes: 1 addition & 2 deletions imp/lib/Mime/Status.php
Expand Up @@ -35,8 +35,7 @@ class IMP_Mime_Status
*/
public $views = array(
Horde_Registry::VIEW_BASIC,
Horde_Registry::VIEW_DYNAMIC,
Horde_Registry::VIEW_MINIMAL
Horde_Registry::VIEW_DYNAMIC
);

/**
Expand Down
3 changes: 1 addition & 2 deletions imp/lib/Mime/Viewer/Alternative.php
Expand Up @@ -68,8 +68,7 @@ protected function _IMPrender($inline)

$display_ids = $ret = array();

$prefer_plain = (($GLOBALS['registry']->getView() == Horde_Registry::VIEW_MINIMAL) ||
($GLOBALS['prefs']->getValue('alternative_display') == 'text'));
$prefer_plain = ($GLOBALS['prefs']->getValue('alternative_display') == 'text');

/* Look for a displayable part. RFC: show the LAST choice that can be
* displayed inline. If an alternative is itself a multipart, the user
Expand Down
35 changes: 10 additions & 25 deletions imp/lib/Mime/Viewer/Html.php
Expand Up @@ -70,28 +70,16 @@ protected function _render()
*/
protected function _renderInline()
{
global $page_output, $registry;
global $page_output;

$data = $this->_IMPrender(true);
$uid = strval(new Horde_Support_Randomid());

switch ($view = $registry->getView()) {
case $registry::VIEW_MINIMAL:
$data['status'] = new IMP_Mime_Status(array(
_("This message part contains HTML data, but this data can not be displayed inline."),
$this->getConfigParam('imp_contents')->linkView($this->_mimepart, 'view_attach', _("View HTML data in new window."))
));
break;

default:
$uid = strval(new Horde_Support_Randomid());
$page_output->addScriptPackage('IMP_Script_Package_Imp');

$page_output->addScriptPackage('IMP_Script_Package_Imp');

$data['metadata'] = array(array('html', $uid, $data['data']));
$data['data'] = '<div>' . _("Loading...") . '</div><iframe class="htmlMsgData" id="' . $uid . '" src="javascript:false" frameborder="0" style="display:none;height:auto;"></iframe>';
$data['type'] = 'text/html; charset=UTF-8';
break;
}
$data['metadata'] = array(array('html', $uid, $data['data']));
$data['data'] = '<div>' . _("Loading...") . '</div><iframe class="htmlMsgData" id="' . $uid . '" src="javascript:false" frameborder="0" style="display:none;height:auto;"></iframe>';
$data['type'] = 'text/html; charset=UTF-8';

return array(
$this->_mimepart->getMimeId() => $data
Expand Down Expand Up @@ -141,11 +129,9 @@ protected function _IMPrender($inline)
$view = $registry->getView();

$contents = $this->getConfigParam('imp_contents');
$convert_text = ($view == $registry::VIEW_MINIMAL) ||
$injector->getInstance('Horde_Variables')->convert_text;
$convert_text = $injector->getInstance('Horde_Variables')->convert_text;

/* Don't do IMP DOM processing if in mimp mode or converting to
* text. */
/* Don't do IMP DOM processing if converting to text. */
$this->_imptmp = array();
if ($inline && !$convert_text) {
$this->_imptmp += array(
Expand All @@ -168,7 +154,7 @@ protected function _IMPrender($inline)

/* Sanitize the HTML. */
$data = $this->_cleanHTML($data, array(
'noprefetch' => ($inline && ($view != Horde_Registry::VIEW_MINIMAL)),
'noprefetch' => $inline,
'phishing' => $inline
));

Expand Down Expand Up @@ -196,8 +182,7 @@ protected function _IMPrender($inline)
));
}

/* We are done processing if in mimp mode, or we are converting to
* text. */
/* We are done processing if converting to text. */
if ($convert_text) {
$data = $this->_textFilter($data, 'Html2text', array(
'wrap' => false
Expand Down

0 comments on commit 1707431

Please sign in to comment.