Browse Source

- Half way fixing duplicated news on requesting olders

- Half way fixing no autoheight fot textarea on editing presence form
pull/16/head
Christine Ho 11 years ago
parent
commit
947484c37a
  1. 1
      app/assets/js/movim_utils.js
  2. 23
      app/widgets/Menu/Menu.php

1
app/assets/js/movim_utils.js

@ -121,6 +121,7 @@ function movim_form_to_json(formname) {
* @param DOMElement textbox
*/
function movim_textarea_autoheight(textbox) {
console.log("movim_textarea_autoheight");
if(textbox != null ) {
textbox.style.height = 0;
textbox.style.height = textbox.scrollHeight +"px";

23
app/widgets/Menu/Menu.php

@ -97,30 +97,39 @@ class Menu extends WidgetCommon
}
function prepareList($type = 'all', $server = null, $node = null, $page = 0) {
movim_log(__METHOD__);
$view = $this->tpl();
$pd = new \Modl\PostnDAO;
Cache::c('since', date(DATE_ISO8601, strtotime($pd->getLastDate())));
$count = $pd->getCountSince(Cache::c('since'));
// getting newer, not older
if($page == 0){
$count = 0;
Cache::c('since', date(DATE_ISO8601, strtotime($pd->getLastDate())));
}
$next = $page + 1;
switch($type) {
case 'all' :
$view->assign('history', $this->call('ajaxGetAll', $next));
$items = $pd->getAllPosts(false, $page*$this->_paging, $this->_paging);
$items = $pd->getAllPosts(false, $page * $this->_paging + $count, $this->_paging);
movim_log("ALL ".$page * $this->_paging + $count);
break;
case 'news' :
$view->assign('history', $this->call('ajaxGetNews', $next));
$items = $pd->getNews($page*$this->_paging, $this->_paging);
$items = $pd->getNews($page * $this->_paging + $count, $this->_paging);
movim_log("NEWS ".$page * $this->_paging + $count);
break;
case 'feed' :
$view->assign('history', $this->call('ajaxGetFeed', $next));
$items = $pd->getFeed($page*$this->_paging, $this->_paging);
$items = $pd->getFeed($page * $this->_paging + $count, $this->_paging);
movim_log("FEED ".$page * $this->_paging + $count);
break;
case 'node' :
$view->assign('history', $this->call('ajaxGetNode', '"'.$server.'"', '"'.$node.'"', $next));
$items = $pd->getNode($server, $node, $page*$this->_paging, $this->_paging);
$items = $pd->getNode($server, $node, $page * $this->_paging + $count, $this->_paging);
movim_log("NODE ".$page * $this->_paging + $count);
break;
}

Loading…
Cancel
Save