diff options
author | James Bottomley <JBottomley@Parallels.com> | 2013-12-16 13:07:22 -0800 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-12-16 13:07:22 -0800 |
commit | 724b9fc1ebd24a99658bfd71c13e526e3bfdbfc1 (patch) | |
tree | 220ac477ebc3b6416b6df002164f7ae2934d8da4 | |
parent | 6a37be5f964f840966e899b620ac06583b3d72ea (diff) | |
download | asterisk-aastra-724b9fc1ebd24a99658bfd71c13e526e3bfdbfc1.tar.gz |
Fix Empty list and title handing
Empty list should say that. Lists should also share the title of the manager
they're managing.
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | include/BaseList.class.php | 6 | ||||
-rw-r--r-- | include/BlacklistManager.class.php | 2 | ||||
-rw-r--r-- | include/TextScreen.class.php | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/include/BaseList.class.php b/include/BaseList.class.php index 9c981fe..f2cd743 100644 --- a/include/BaseList.class.php +++ b/include/BaseList.class.php @@ -32,7 +32,11 @@ class BaseList extends TextScreen { $pages = intval((count($this->data)+3)/$this->_phone['entries']); $down = $this->page + 1 == $pages ? null : $this->url.'&page='.($this->page + 1).'&index='.$this->_phone['entries']; $up = $this->page == 0 ? null : $this->url.'&page='.($this->page - 1).'&index=0'; - parent::setTitle($this->title.' Page: '.($this->page+1).'/'.$pages); + if ($pages) { + parent::setTitle($this->title.' Page: '.($this->page+1).'/'.$pages); + } else { + parent::setTitle($this->title.' List Empty'); + } $this->setStyle('none'); if ($up) { $this->setScrollUp($up); diff --git a/include/BlacklistManager.class.php b/include/BlacklistManager.class.php index ac984d3..0c5fd0d 100644 --- a/include/BlacklistManager.class.php +++ b/include/BlacklistManager.class.php @@ -11,6 +11,7 @@ class BlacklistManager extends Blacklist { function white_manager() { $this->title = 'Whitelist'; $list = new DatabaseListManager($this, $this->url.'?action=white_manager'); + $list->setTitle($this->title); $list->manager('whitelist', true, $this->url.'?action=newnum&num='); } @@ -18,6 +19,7 @@ class BlacklistManager extends Blacklist { function black_manager() { $this->title = 'Blacklist'; $list = new DatabaseListManager($this, $this->url.'?action=black_manager'); + $list->setTitle($this->title); $list->manager('blacklist', false, $this->url.'?action=newnum&num='); } diff --git a/include/TextScreen.class.php b/include/TextScreen.class.php index f8fed55..74b212f 100644 --- a/include/TextScreen.class.php +++ b/include/TextScreen.class.php @@ -113,7 +113,7 @@ class TextScreen { if ($this->_cancelAction) { $o->setCancelAction($this->_cancelAction); } - if ($this->_style) { + if ($this->_style && !$this->_phone['formatted']) { $o->setStyle($this->_style); } if ($this->_scrollUp) { @@ -141,8 +141,6 @@ class TextScreen { $o->setTitle($this->_title); if (count($this->_entries) != 0) { #do nothing - } else if (count($this->_text) == 0) { - $o->setText($this->_text[0]); } else if ($this->_phone['formatted']) { foreach($this->_text as $t) { $s = preg_split('/\n/',wordwrap($t, $this->_phone['width'], "\n\xa0\xa0")); @@ -150,6 +148,8 @@ class TextScreen { $o->addLine($l); } } + } else if (count($this->_text) == 0) { + $o->setText($this->_text[0]); } else { $text = ''; foreach($this->_text as $t) { |