示例#1
0
 public static function messageMgmt($action, $task, $message)
 {
     $mainframe = JFactory::getApplication();
     if (empty($message)) {
         if ($GLOBALS[JNEWS . 'news1'] == 1) {
             return jnews::printM('warning', _JNEWS_UPGRADE1 . '<b>Anjel</b>' . _JNEWS_UPGRADE2);
         }
         if ($GLOBALS[JNEWS . 'news2'] == 1) {
             return jnews::printM('warning', _JNEWS_UPGRADE1 . '<b>Letterman</b>' . _JNEWS_UPGRADE2);
         }
         if ($GLOBALS[JNEWS . 'news3'] == 1) {
             return jnews::printM('warning', _JNEWS_UPGRADE1 . '<b>YaNC</b>' . _JNEWS_UPGRADE2);
         }
         if ($GLOBALS[JNEWS . 'mod_pub'] == 0) {
             $total = jnews::getStats();
             $link = '  <a href="index.php?option=com_modules&search=jnews&filter_search=jnews">' . _JNEWS_MOD_PUB_LINK . '</a>';
             if (empty($total) and $GLOBALS[JNEWS . 'act_totalmailing0'] < 3) {
                 return jnews::printM('warning', _JNEWS_MOD_PUB . $link);
             }
         }
         //			if($GLOBALS[JNEWS.'level'] > 1){//check the version is plus or pro
         //				if($GLOBALS[JNEWS.'enable_captcha']){//check if captcha is enabled
         //					if(!extension_loaded('mcrypt')){
         //		            		$link='<a href="index.php?option='.JNEWS_OPTION.'&act=configuration">'._JNEWS_CAPTCHA_LINK.'</a>';
         //		            		return jnews::printM('warning' , _JNEWS_MCRYPT_MESSAGE.$link);
         //		            }
         //				}
         //			}
         if ($GLOBALS[JNEWS . 'act_totalmailing2'] > 0 and $GLOBALS[JNEWS . 'cron_setup'] == 0) {
             return jnews::printM('cron', _JNEWS_SCHEDULE_SETUP);
         }
         //Captcha
         //			if($GLOBALS[JNEWS.'level'] > 1){//check the version is plus or pro
         //            	if($GLOBALS[JNEWS.'enable_captcha']){//check if captcha is enabled
         //            		if (!extension_loaded('gd')) {
         //            			$link='<a href="index.php?option='.JNEWS_OPTION.'&act=configuration">'._JNEWS_CAPTCHA_LINK.'</a>';
         //            			return jnews::printM('warning' , _JNEWS_CAPTCHA_WARN.$link);
         //            		}else{
         //            			$gdinfo = gd_info();
         //						if(!$gdinfo['FreeType Support']) return jnews::printM('warning' , JNEWS_CAPTCHA_FTWARN);
         //            		}
         //
         //            	}
         //			}
         //Queue Status
         if ($mainframe->isAdmin()) {
             if ($GLOBALS[JNEWS . 'level'] > 1) {
                 if ($GLOBALS[JNEWS . 'queue_status'] == 0) {
                     $link = '<a href="index.php?option=' . JNEWS_OPTION . '&act=queue&task=startqueue">start the queue.</a>';
                     return jnews::printM('cron', 'The queue has been stopped if you want to continue proccessing it, you need to ' . $link);
                 }
             }
         }
         if ($GLOBALS[JNEWS . 'show_tips'] == 1) {
             $ou = false;
             $message = jnews::chooseTips($action, $task);
             if (!empty($message)) {
                 return $message;
             }
         }
     }
     return $message;
 }