diff --git a/e107_admin/boot.php b/e107_admin/boot.php index 6d22800b4..7f538ec02 100644 --- a/e107_admin/boot.php +++ b/e107_admin/boot.php @@ -33,6 +33,65 @@ if(ADMIN && defset('e_ADMIN_UI') && varset($_POST['mode']) == 'sef' && !empty($_ exit; } +if(ADMIN && e_AJAX_REQUEST && varset($_GET['mode']) == 'addons' ) +{ + $type = ($_GET['type'] == 'plugin') ? 'plugin' : 'theme'; + $tag = 'infopanel_'.$type; + + $cache = e107::getCache(); + $cache->setMD5('_'); + + if($text = $cache->retrieve($tag,180,true)) // check every 3 hours. + { + echo $text; + + if(e_DEBUG === true) + { + echo "Cached"; + } + exit; + } + + + if($data = e107::getXml()->getRemoteFile('http://e107.org/feed/?limit=3&type='.$type,3)) + { + $rows = e107::getXml()->parseXml($data, 'advanced'); +// print_a($rows); +// exit; + $link = ($type == 'plugin') ? e_ADMIN."plugin.php?mode=online" : e_ADMIN."theme.php?mode=online"; + + $text = "
"; + + foreach($rows[$type] as $val) + { + $meta = $val['@attributes']; + $img = ($type == 'theme') ? $meta['thumbnail'] : $meta['icon']; + $text .= '
'; + $text .= '
+ + + +
+
+

'.$meta['name'].' v'.$meta['version'].' — '.$meta['author'].'

+ '.$val['description'].' +
'; + $text .= '
'; + } + + $text .= "
"; + $text .= "
".LAN_MORE."
"; + + echo $text; + + $cache->set($tag, $text, true); + + } + exit; + +} + + ### Language files e107::coreLan('header', true); e107::coreLan('footer', true); diff --git a/e107_admin/includes/infopanel.php b/e107_admin/includes/infopanel.php index b15b538fd..87fc7271a 100644 --- a/e107_admin/includes/infopanel.php +++ b/e107_admin/includes/infopanel.php @@ -20,6 +20,10 @@ if (!defined('e107_INIT')) define('ADMINFEED', 'http://e107.org/adminfeed'); define('ADMINFEEDMORE', 'http://e107.org/blog'); + + + + class adminstyle_infopanel { @@ -33,11 +37,16 @@ class adminstyle_infopanel jQuery(function($){ - $('#e-adminfeed').rssfeed('".ADMINFEED."', { + $('#e-adminfeed').rssfeed('".ADMINFEED."', { limit: 3, header: false, linktarget: '_blank' }); + + $('#e-adminfeed-plugin').load('".e_ADMIN."admin.php?mode=addons&type=plugin'); + + $('#e-adminfeed-theme').load('".e_ADMIN."admin.php?mode=addons&type=theme'); + }); "; @@ -201,8 +210,13 @@ class adminstyle_infopanel // ------------------------------- e107 News -------------------------------- - - $text2 = $ns->tablerender("e107 News","
".LAN_MORE."
","core-infopanel_news",true); + + $newsTabs = array(); + $newsTabs['core'] = array('caption'=>'General','text'=>"
".LAN_MORE."
"); + $newsTabs['plugin'] = array('caption'=>'Plugins','text'=>"
"); + $newsTabs['theme'] = array('caption'=>'Themes','text'=>"
"); + + $text2 = $ns->tablerender("Latest e107 News",e107::getForm()->tabs($newsTabs, array('active'=>'core')),"core-infopanel_news",true); @@ -374,6 +388,7 @@ class adminstyle_infopanel $ol = e107::getOnline(); $tp = e107::getParser(); + $multilan = e107::getPref('multilanguage'); $panelOnline = " @@ -383,7 +398,15 @@ class adminstyle_infopanel - + "; + + + $panelOnline .= (!empty($multilan)) ? "" : ""; + + + // TODO LAN + $panelOnline .= " + @@ -391,10 +414,16 @@ class adminstyle_infopanel Username IP Page - Agent + Agent"; + + $panelOnline .= (!empty($multilan)) ? "Lang." : ""; + + $panelOnline .= " - "; + "; + + $online = $ol->userList() + $ol->guestList(); @@ -403,8 +432,10 @@ class adminstyle_infopanel return count($online); } - // echo "Users: ".print_a($online); - + // echo "Users: ".print_a($online); + + $lng = e107::getLanguage(); + foreach ($online as $val) { $panelOnline .= " @@ -413,7 +444,12 @@ class adminstyle_infopanel ".$this->renderOnlineName($val['online_user_id'])." ".e107::getIPHandler()->ipDecode($val['user_ip'])." ".$tp->html_truncate(basename($val['user_location']),50,"...")." - ".$this->browserIcon($val)." + ".$this->browserIcon($val).""; + + $panelOnline .= (!empty($multilan)) ? "convert($val['user_language'])."\">".$val['user_language']."" : ""; + + + $panelOnline .= " "; } diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 81878c137..4f3770062 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -208,7 +208,7 @@ class e_form */ function tabs($array,$options = array()) { - + $initTab = varset($options['active'],false); $text =' '; + $initTab = varset($options['active'],false); + $text .= '
'; @@ -235,12 +242,19 @@ class e_form $c=0; foreach($array as $key=>$tab) { + + if(is_numeric($key)) { $key = 'tab-'.$this->name2id($tab['caption']); } + + if($c == 0 & $initTab == false) + { + $initTab = $key; + } - $active = ($c == 0) ? ' active' : ''; + $active = ($key == $initTab) ? ' active' : ''; $text .= '
'.$tab['text'].'
'; $c++; } diff --git a/e107_handlers/online_class.php b/e107_handlers/online_class.php index c75b12aeb..a687c3bf9 100755 --- a/e107_handlers/online_class.php +++ b/e107_handlers/online_class.php @@ -265,7 +265,8 @@ class e_online 'user_pagecount' => $row['online_pagecount'], 'user_active' => $row['online_active'], 'user_image' => vartrue($row['user_image'],false), - 'online_user_id' => $row['online_user_id'] + 'online_user_id' => $row['online_user_id'], + 'user_language' => $row['online_language'] ); if($row['online_user_id'] != 0 )