static function getNoResult($message, $options = NULL) { $defaults = array("hkey" => NULL, "form" => "vanilla"); $settings = Util::getSettings($options, $defaults); //get qparams from Url $qparams = \com\indigloo\Url::getRequestQueryParams(); $gpage = -1; //hkey supplied - means show help on page #1. if (!empty($qparams) && isset($qparams["gpage"])) { $gpage = $qparams["gpage"]; $gpage = intval($gpage); } else { $gpage = 1; } $html = NULL; $help_key = $settings["hkey"]; if ($gpage <= 1 && !is_null($help_key)) { try { $html = self::getHelp($help_key); return $html; } catch (\Exception $ex) { $html = NULL; $errorMsg = $ex->getMessage(); Logger::getInstance()->error($errorMsg); Logger::getInstance()->error($ex->getMessage()); } } $view = new \stdClass(); $template = NULL; $form = $settings["form"]; switch ($form) { case "tile": $template = "/fragments/site/noresult/tile.tmpl"; break; default: $template = "/fragments/site/noresult/vanilla.tmpl"; break; } $view->message = $message; $html = Template::render($template, $view); return $html; }
static function getTable($loginId, $rows, $source, $options) { $html = NULL; $view = new \stdClass(); $defaults = array("ui" => "table", "image" => false); $settings = Util::getSettings($options, $defaults); $records = array(); foreach ($rows as $row) { $record = array(); $userId = $row['login_id']; $pubUserId = PseudoId::encode($userId); $pubUserUrl = "/pub/user/" . $pubUserId; $record['pubUserUrl'] = $pubUserUrl; $record['name'] = $row['name']; $record['followingId'] = $userId; $record['followerId'] = $loginId; $record['hasImage'] = false; /* if(!Util::tryEmpty($row["photo_url"])) { $record['srcImage'] = $row["photo_url"]; $record['hasImage'] = true ; }else { $record['srcImage'] = UIConstants::PH2_PIC; } */ $record['srcImage'] = UIConstants::PH3_PIC; $records[] = $record; } $view->records = $records; settype($source, "integer"); $template = self::getTemplate($source, $settings["ui"], $settings["image"]); $html = Template::render($template, $view); return $html; }