/** * @param object $tpl template object to initialize if needed * @return bool|null|CANVASAdmin */ public static function getApp($tpl = null) { if (empty(self::$canvasapp)) { $japp = JFactory::getApplication(); self::$canvasapp = $japp->isAdmin() ? self::getAdmin() : self::getSite($tpl); } return self::$canvasapp; }