public function testGetAsset() { $asset = $this->getMockForAbstractClass('\\Magento\\Framework\\View\\Asset\\LocalInterface'); $this->fileManager->expects($this->once())->method('createRequireJsAsset')->will($this->returnValue($asset)); $object = new Config($this->context, $this->config, $this->fileManager); $this->assertSame($asset, $object->getAsset()); $this->assertSame($asset, $object->getAsset(), 'Asset is supposed to be cached in-memory'); }
function showCategory($categoryStd, $level) { $level0 = $level == 0 ? $categoryStd->name : ""; $level1 = $level == 1 ? $categoryStd->name : ""; $level2 = $level == 2 ? $categoryStd->name : ""; $return = "<tr class=\"gradeX\">"; $return .= "<td class=\"con0\">" . $level0 . "</td>"; $return .= "<td class=\"con1\">" . $level1 . "</td>"; $return .= "<td class=\"con0\">" . $level2 . "</td>"; $return .= "<td class=\"center con1\">\n \t<a href=\"" . Config::getRootPath("backend/category/edit/level.{$level}/id." . $categoryStd->id) . "\" class=\"iconlink2\"><img src=\"" . Config::getAsset('backend/assets/images/icons/small/black/edit.png') . "\" alt=\"\"></a>\n \t<a href=\"" . Config::getRootPath("backend/category/delete/id." . $categoryStd->id) . "\" class=\"iconlink2\"><img src=\"" . Config::getAsset('backend/assets/images/icons/small/black/close.png') . "\" alt=\"\"></a> \t\n \t</td>\n \t"; return $return; }
<td><?php echo $row->id; ?> </td> <td><?php echo $row->title; ?> </td> <td><?php echo $row->slug; ?> </td> <td></td> <td> <?php echo "<a href=\"" . Config::getRootPath("backend/info_segmento/change/id." . $row->id) . "\" class=\"iconlink2\"><img src=\"" . Config::getAsset('backend/assets/images/icons/small/black/edit.png') . "\" alt=\"\"></a>\n \t<a href=\"" . Config::getRootPath("backend/info_segmento/delete/id." . $row->id) . "\" class=\"iconlink2\"><img src=\"" . Config::getAsset('backend/assets/images/icons/small/black/close.png') . "\" alt=\"\"></a>"; ?> </td> </tr> <?php } } ?> </tbody> <tfoot> <tr> <th class="head1">ID</th> <th class="head1">Página</th> <th class="head0">Slug</th> <th class="head1"></th> <th class="head0">Ações</th>
echo $row->id; ?> "><?php echo $row->id; ?> </td> <td align="center"><img src="<?php echo Config::getRootPath("image/get_image/image_id." . $row->id . "/max_width.80/max_height.255"); ?> " alt="" /></td> <td><?php echo $row->url; ?> </td> <td align="center"><?php echo "<a href=\"" . Config::getRootPath("backend/info/delete_image/product_id." . $HttpContentResult->vo->id . "/id." . $row->id . "/type." . $HttpContentResult->gallery_type) . "\" class=\"iconlink2\"><img src=\"" . Config::getAsset('backend/assets/images/icons/small/black/close.png') . "\" alt=\"\"></a>"; ?> </td> </tr> <?php } } ?> </tbody> </table> </div><!--sTableWrapper--> </div><!-- listview --> </div><!--gallery-->
<!-- The Templates and Load Image plugins are included for the FileUpload user interface --> <script src="http://blueimp.github.com/JavaScript-Templates/tmpl.min.js"></script> <script src="http://blueimp.github.com/JavaScript-Load-Image/load-image.min.js"></script> <!-- Bootstrap Modal and Image Gallery are not required, but included for the demo --> <script src="http://twitter.github.com/bootstrap/1.4.0/bootstrap-modal.min.js"></script> <script src="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-image-gallery.min.js"></script> <!-- The Iframe Transport is required for browsers without support for XHR file uploads --> <script src="<?php echo Config::getAsset('backend/assets/upload/jquery.iframe-transport.js'); ?> "></script> <script src="<?php echo Config::getAsset('backend/assets/upload/jquery.fileupload.js'); ?> "></script> <script src="<?php echo Config::getAsset('backend/assets/upload/jquery.fileupload-ui.js'); ?> "></script> <script src="<?php echo Config::getAsset('backend/assets/upload/application.js'); ?> "></script> <!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ --> <!--[if gte IE 8]><script src="<?php echo Config::getAsset('backend/assets/upload/cors/jquery.xdr-transport.js'); ?> ></script><![endif]--> </div> </body> </html>
//Config::getAsset($caminho_a_partir_da_view); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <title>Teto</title> <meta name="viewport" content="user-scalable=yes, width=device-width, initial-scale=1.0, maximum-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes" /> <link rel="stylesheet" media="screen" href="<?php echo Config::getAsset('/assets/css/reset.css'); ?> " /> <link rel="stylesheet" media="screen" href="<?php echo Config::getAsset('/assets/css/home.css'); ?> " /> <script type="text/javascript"><?php include Config::getFolderView('/assets/js/home.php'); ?> </script> </head> <body> <div id="content"> <div id="header"> <ul> <li style="margin-left:60px;"><a href="<?php echo Config::getRootPath('produtos'); ?> ">Produtos</a></li>
" class="users"><span>Equipe</span></a></li> <li <?php if (count($array_folders) > 1 && ($array_folders[1] == 'info' || $array_folders[1] == 'info_segmento')) { echo ' class="current"'; } ?> ><a href="<?php echo Config::getRootPath('backend/info_segmento/show'); ?> " class="elements"><span>Infos</span></a></li> </ul> </div><!-- tabmenu --> <div class="accountinfo" style="width:200px;"> <img src="<?php echo Config::getAsset('backend/assets/images/avatar.png'); ?> " alt="Avatar" /> <div class="info" style="float:right;"> <h3>Sérgio Fix</h3> <p> <a href=""></a> <a href="<?php echo Config::getRootPath("backend/login/logout/"); ?> ">Logout</a> </p> </div><!-- info --> </div><!-- accountinfo --> </div><!-- header -->
public function show($_return = FALSE) { $url_config = Config::getRootPath("config"); $head = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n"; $head .= '<html xmlns="http://www.w3.org/1999/xhtml">' . "\n"; $head .= '<head>' . "\n"; $head .= '<meta http-equiv="X-UA-Compatible" content="IE=edge" >' . "\n"; $head .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n"; $head .= '<meta name="description" content="' . $this->description . '" />' . "\n"; $head .= '<meta name="keywords" content="' . $this->keywords . '" />' . "\n"; $head .= '<title>' . $this->title . '</title>' . "\n"; $head .= '<link rel="shortcut icon" type="image/x-icon" href="' . Config::getImagePath("favicon.ico") . '" />'; $head .= "\n<script type=\"text/javascript\" >"; //pega as variaveis do config php e deixa visivel para js em contexto global $head .= "var ROOT_PATH = '" . Config::getRootPath() . "';"; $head .= "var NEXT_URL = '" . Config::getNextUrl() . "';"; $head .= "var LAST_URL = '" . Config::getLastUrl() . "';"; $head .= "var LOCALE = '" . Config::getLocale() . "';"; $head .= "</script>\n"; $head .= '<link rel="apple-touch-icon" href="' . Config::getImagePath("icon-ipad.jpg") . '" />'; foreach ($this->css as $slug => $data) { $file_path = $slug . '.css'; $uri_path = Config::getAsset('assets/css/' . $file_path); $sys_path = Config::getFolderView('assets/css/' . $file_path); if (!file_exists($sys_path)) { $file_path = strpos('.css', $data->path) === FALSE ? $data->path . '.css' : $data->path; $uri_path = Config::getAsset('assets/' . $file_path); $sys_path = Config::getFolderView('assets/' . $file_path); if (!file_exists($sys_path)) { var_dump($slug, '---', $data, $file_path); echo "<!-- arquivo CSS {$uri_path} não encontrado (tentando no file_system : {$sys_path} )-->\n"; exit; continue; } } if ($data->ieOnly) { $head .= "\n<!--[if IE]>"; } $head .= "\n<link type=\"text/css\" media=\"" . $data->media . "\" rel=\"stylesheet\" href=\"" . $uri_path . "\" />"; if ($data->ieOnly) { $head .= "\n<![endif]-->"; } } foreach ($this->js as $slug => $path) { $file_path = $slug . '.js'; $uri_path = Config::getAsset('assets/js/' . $file_path); $sys_path = Config::getFolderView('assets/js/' . $file_path); if (!file_exists($sys_path)) { $file_path = strpos('.js', $path) === FALSE ? $path . '.js' : $path; $uri_path = Config::getAsset('assets/' . $file_path); $sys_path = Config::getFolderView('assets/' . $file_path); if (!file_exists($sys_path)) { echo "<!-- arquivo JS {$uri_path} não encontrado (tentando no file_system : {$sys_path} )-->\n"; continue; } } $head .= "\n<script type=\"text/javascript\" src=\"" . $uri_path . "\"></script>"; } $head .= "\n</head>"; if ($_return) { return $head; } echo $head; }
} }); }); </script> <link rel="stylesheet" href="<?php echo Config::getAsset('backend/assets/css/plugins/jquery.wysiwyg.css'); ?> " type="text/css"/> <script type="text/javascript" src="<?php echo Config::getAsset('backend/assets/js/plugins/wysiwyg/jquery.wysiwyg.js'); ?> "></script> <script type="text/javascript" src="<?php echo Config::getAsset('backend/assets/js/plugins/wysiwyg/wysiwyg.image.js'); ?> "></script> <script type="text/javascript" src="<?php echo Config::getAsset('backend/assets/js/plugins/wysiwyg/wysiwyg.link.js'); ?> "></script> <script type="text/javascript" src="<?php echo Config::getAsset('backend/assets/js/plugins/wysiwyg/wysiwyg.table.js'); ?> "></script> </head>
/** * @return HttpResult */ public function insert() { $returnResult = new HttpResult(); $retornoDaPaginaHTML = new HttpAdminGenericResult(); $ReturnResultVO = new ReturnResultVO(); $senha = DataHandler::getValueByArrayIndex($_POST, "password"); $confirm_password = DataHandler::getValueByArrayIndex($_POST, "confirm_password"); /** * Array( [first_name] => fulanidio [last_name] => farofeiro [email] => renato@gmailfofofo [company] => teste [occupation] => teste prof [interests] => Array ( [0] => restaurantes [1] => escritorio [2] => newsletter ) [user_type] => arquiteto ) */ $_POST["name"] = $_POST["first_name"]; $_POST["recive_news"] = isset($_POST["interests"]) && is_array($_POST["interests"]) && in_array("recive_news", $_POST["interests"]) ? 1 : 0; $_POST["website"] = isset($_POST["user_type"]) ? $_POST["user_type"] : ""; //interesses gravei no rg if (isset($_POST["interests"])) { $_POST["rg"] = isset($_POST["interests"]) && is_array($_POST["interests"]) ? json_encode($_POST["interests"]) : $_POST["interests"]; } $VO = new UserDetailVO($_POST); if ($senha != NULL) { if ($senha == NULL || $senha != $confirm_password) { $ReturnResultVO->success = FALSE; $ReturnResultVO->addMessage("confimação de senha incorreta"); } else { $VO->setActive(0); $VO->setUserTypeId(0); $ReturnResultVO = $VO->commit(TRUE); if ($ReturnResultVO->success) { $smtp = new Smtp(Config::SYSTEM_MAIL_SMTP, 587); $smtp->user = Config::SYSTEM_MAIL_LOGIN; $smtp->pass = Config::SYSTEM_MAIL_PASSWORD; ob_start(); $smtp->debug = true; // $from = "'" . $postData->sender_name . "' <" . Config::SYSTEM_MAIL_FROM . ">" ; // $to = "'" . $postData->sender_name . "' <" . $postData->receiver_mail . ">" ; $from = Config::SYSTEM_MAIL_FROM; $to = $VO->getEmail(); $subject = "Teto confirmação de cadastro"; $mensagem = file_get_contents(Config::getFolderView("/templates/email_para_cadastrado.html")); $mensagem = str_replace("###name", $VO->getName(), $mensagem); $token = $this->getTokenFromUser($VO->id, $VO->getEmail()); //url para o cara confirmar $url_confirmation = Config::getRootPath("/user/confirm/id." . $VO->getId() . "/mail." . $VO->getEmail() . "/token.{$token}"); $mensagem = str_replace("###url_confirmacao", $url_confirmation, $mensagem); $smtp->Send($to, $from, $subject, $mensagem, "text/html"); ob_end_clean(); } } if ($ReturnResultVO->success) { //Navigation::redirect("admin/user"); $message_success = file_get_contents(Config::getAsset("templates/cadastro_sucesso.txt")); $ReturnResultVO->addMessage($message_success); } $retornoDaPaginaHTML->return_result_vo = $ReturnResultVO; } else { $ReturnResultVO->addMessage("envie a senha"); } echo $ReturnResultVO->toJson(); exit; $retornoDaPaginaHTML->user_detail_vo = $VO; //iniciando o retorno padrao em http result $returnResult->setHttpContentResult($retornoDaPaginaHTML); return $returnResult; }
public function check() { //busca o post $login = DataHandler::getValueByArrayIndex($_POST, "login"); $password = DataHandler::getValueByArrayIndex($_POST, "password"); //iniciando o retorno padrao em http client ajax $returnResult = new ReturnResultVO(); //se não validar retornar erro if (!Validation::blank($password, 1) && !Validation::blank($login, 1)) { $returnResult->success = 0; $returnResult->addMessage("Envie Login e Senha"); } else { //cadastra o usuario e os detalhes do mesmo $DAO = UserDetailDAO::getInstance(); $ReturnDataVO = $DAO->checkLogin($login, $password); if ($ReturnDataVO->success && count($ReturnDataVO->result) > 0) { UserClient::setId($ReturnDataVO->result[0]->id); UserClient::setTypeId($ReturnDataVO->result[0]->user_type_id); UserClient::setActiveTime(time()); //setando sucesso true caso tenha dado certo $returnResult->success = $ReturnDataVO->success; $message_success = file_get_contents(Config::getAsset("templates/login_sucesso.txt")); $returnResult->addMessage($message_success); } else { //print_r($ReturnDataVO); $returnResult->success = 0; $returnResult->addMessage("Erro ao Logar!"); } } if ($returnResult->success) { if ($this->to != "") { Navigation::redirect($this->to); } } echo $returnResult->toJson(); exit; }