function status() { $page = CurrentPageName(); $tpl = new templates(); $cache_file = dirname(__FILE__) . "/ressources/logs/web/squid.status.html"; $footer = $tpl->_ENGINE_parse_body("\n\t<div class='post'>\n\t<h1 class=\"title\" style='text-transform:capitalize'>{today_downloaded_flow}</h1>\n\t<center>" . squid_events_hours() . "</center>\n\t</div>\n\t\n\t"); $script = "<script>LoadAjax('RightMenu1','{$page}?RightMenu1=yes');</script>"; if (is_file($cache_file)) { echo $tpl->_ENGINE_parse_body("<div class='post'>\n\t<h1 class=\"title\" style='text-transform:capitalize'>{WELCOME_ARTICA_STATS_SQUID}</h1>" . @file_get_contents($cache_file)) . "\n\t</div>{$footer}{$script}"; return; } writelogs("{$cache_file} no such file", __FUNCTION__, __FILE__, __LINE__); $status = new status(); echo $tpl->_ENGINE_parse_body("<div class='post'>\n\t<h1 class=\"title\" style='text-transform:capitalize'>{WELCOME_ARTICA_STATS_SQUID}</h1>\n\t" . $status->Squid_status()) . "\n\t</div>{$footer}{$script}\n\t\n\t\n\t"; }
function __construct($header) { //TODO use https when loggin in // use ssh for login // $host = "https://" . OLIV_SSH_HOST . "/" . OLIV_BASE . "index.php"; $host = "http://" . system::OLIV_SSH_HOST() . "/" . system::OLIV_BASE() . "index.php"; // load login content xml $this->content = OLIVModule::load_content($header); // select template for logged of not logged if (status::OLIV_USER()) { $header->param->template = "logged"; $this->content->username = OLIVUser::getName(status::OLIV_USER()); if (status::OLIV_SU()) { $this->content->su = status::OLIV_SU(); } else { $this->content->user_groups = OLIVUser::getGroupName(status::OLIV_USER()); } } else { // check if wrong login if (argv::action() == "login") { $header->param->template = "incorrect"; } } // load correct template $this->template = OLIVModule::load_template($header); }
function PageFetchmail_status() { include_once 'ressources/class.fetchmail.inc'; $tpl = new templates(); $yum = new usersMenus(); if ($yum->AsMailBoxAdministrator == false) { $html = $tpl->_ENGINE_parse_body("<h3>{not allowed}</H3>"); return $html; } $status = new status(1); $stat = $status->fetchmail_satus(); $html = $stat; if ($usersmenus->AutomaticConfig == false) { $html = $html . "<br><fieldset><legend>{apply config}</legend>\n\t\t\t\t\t<center><input type='button' value='{apply config}' OnClick=\"javascript:TreeFetchMailApplyConfig()\"></center>\n\t\t\t\t</fieldset>"; } $fetch = new fetchmail(); if (is_array($fetch->array_servers)) { $html = $html . "<fieldset>\n\t\t\t\t<legend>{servers_list}</legend>\n\t\t\t\t<center>\n\t\t\t\t<table style='width:90%;border:1px solid #CCCCCC'>\n\t\t\t\t<tr style='border-bottom:1px solid #CCCCCC'>\n\t\t\t\t\t<td colspan=2><strong>{servers_list}</td>\n\t\t\t\t\t<td align='center'><strong>{number_users}</strong></td>\n\t\t\t\t</tr>"; while (list($num, $val) = each($fetch->array_servers)) { $html = $html . "<tr>\n\t\t\t\t\t<td width=1%><img src='img/webmin_on-22.gif'></td>\n\t\t\t\t\t<td><a href=\"javascript:TreeFetchmailShowServer('{$num}');\">{$num}</a></td>\n\t\t\t\t\t<td align='center'>" . count($val) . "</td>\n\t\t\t\t\t</tr>"; } $html = $html . "</table></center></fieldset>"; } return $tpl->_ENGINE_parse_body("<div id=status>{$html}</div>"); }
/** * Email admin * @param string $status Message status e.g. error, success, debug * @param string $msg Message to email * @param boolean $email Email to admin, default false * @return boolean */ public static function emailAdmin($status, $msg) { // Check admin email constants are defined if (!defined('EMAIL_FROM')) { status::Output('ERROR', 'EMAIL_FROM not specified'); return; } if (!defined('AUTHOR_NAME')) { status::Output('ERROR', 'AUTHOR_NAME not specified'); return; } if (!defined('AUTHOR_EMAIL')) { status::Output('ERROR', 'AUTHOR_EMAIL not specified'); return; } // Create email $email = new Email(); if (defined('EMAIL_SMTP') && EMAIL_SMTP) { $email->setSMTPStream(); } else { $email->setPHPMail(); } // Set message $email->addHTML("\n\t\t\t<p>CLI email from " . EMAIL_DOMAIN . ":<br />\n\t\t\tstatus: " . $status . "<br />\n\t\t\tmessage: " . nl2br($msg) . "\n\t\t\t</p>\n\t\t"); // Send to admin $email->addRecipient(AUTHOR_EMAIL, AUTHOR_NAME); if ($email->Send(EMAIL_FROM, 'CLI Message') && !\Sonic\Message::count('error')) { return TRUE; } else { return FALSE; } }
public static function selector($langXml) { // create lang selector $langSelector = new simpleXmlElement("<lang_selector/>"); if ($langXml) { foreach ($langXml as $entry) { $langCode = $entry->getName(); //echoall($langCode); $countryCode = OLIVLang::defaultCountry($langCode); // make current language bigger $id = "oliv_lang_flag"; if ($langCode == status::lang()) { $id = "oliv_lang_flag_selected"; } //get string for url title language name $title = OLIVText::_("change_language", $langCode); $title .= " - " . OLIVText::_($langCode, $langCode); // full language name // create flag image // $img = new simpleXmlElement("<img url='" . status::url() . "' urllang='" . $langCode . "' urltitle='{$title}' src='oliv_flag' id='{$id}' lang='" . $countryCode . "' />"); $img = new simpleXmlElement("<selector><a href='current()' title='{$title}' lang='" . $langCode . "'/><img id='{$id}' lang='" . $countryCode . "'>oliv_flag</img></selector>"); // insert image olivxml_insert($langSelector, $img, "ALL"); } //echoall($langSelector->asXML()); return $langSelector; } }
public static function xml($text, $lang = "") { if (!$lang) { $lang = status::lang(); } if ($text) { // multilingual text found if ($text->text) { $textNode = $text->XPath("../."); $xpath = "text[@lang='{$lang}']"; $default_xpath = "text[@lang='" . system::OLIV_DEFAULT_LANG() . "']"; $tempText = $text->XPath($xpath); $defaultTempText = $text->XPath($default_xpath); // return language test if (count($tempText) > 0) { return (string) $tempText[0]; } else { if (count($defaultTempText)) { return (string) $defaultTempText[0]; } } } else { return (string) $text; } } return FALSE; }
private function status_bind($id, $text, $pic_id) { include_once ROOT_DIR . 'lib/user/user.class.php'; $this->mUser = new user(); $bind_info = $this->mUser->get_bind_info(); //获取绑定信息 include_once ROOT_PATH . 'lib/class/status.class.php'; $status = new status(); if (!$bind_info) { //do nothing! } else { //file_put_contents('d:/show.txt', '用户绑定了' , FILE_APPEND); $bind_info = $bind_info[0]; if ($bind_info['state'] == 1 && $bind_info['last_key']) { //file_put_contents('d:/show.txt', '用户开启同步了' , FILE_APPEND); include_once ROOT_PATH . 'lib/class/weibooauth.class.php'; $last_key = unserialize($bind_info['last_key']); $oauth = new WeiboClient(WB_AKEY, WB_SKEY, $last_key['oauth_token'], $last_key['oauth_token_secret']); //$oauth = new WeiboOAuth( WB_AKEY , WB_SKEY , 'e9b1d743a687550cec725e65fd204b6c' , '119934aabf1632d426533505c0f02e70' ); //判断是否发送了图片 if ($pic_id) { //file_put_contents('d:/show.txt', '用户发送了图片' , FILE_APPEND); //取出该图片的路径 //获取媒体信息 $pic_url = $status->getPicById($pic_id); $url = $pic_url[0]; //$url = 'http://127.0.0.1/3.jpg'; $content = $oauth->upload($text, $url); } else { $content = $text; $pattern = "/#([\\x{4e00}-\\x{9fa5}0-9A-Za-z_-\\s‘’“”'\"!\\?\$%&:;!?¥×\\*\\<\\>》《]+)[\\s#]/iu"; if (preg_match_all($pattern, $content, $topic)) { include_once ROOT_PATH . 'lib/class/shorturl.class.php'; $shorturl = new shorturl(); $link = ''; $tmp_url = ''; $topic_name = array(); foreach ($topic[1] as $key => $value) { $tmp_url = SNS_MBLOG . 'k.php?q=' . urlencode($value); $short_url = $shorturl->shorturl($tmp_url); $link .= $short_url; } $content = $content . $link; } // $content = $oauth->post( $oauth->updateURL() , array( 'status' => $content) ); $content = $oauth->update($content); //同步发送 } $syn_id = $content['id']; //返回点滴的ID $type = $bind_info['type']; //绑定类型 /** * 记录同步发送的点滴id */ $status->syn_relation($id, $syn_id, $type); } } }
public function getSearch() { $content = new simpleXmlElement("<search></search>"); if (argv::action() == "search") { OLIVPlugin::call($content, "search"); status::set("search_result", $content); } }
public static function get_info() { $UserName = $_POST['UserName']; $PassWord = $_POST['PassWord']; $appID = $_GET['appID']; $type = $_GET['ask_method']; if ($UserName == "" || $PassWord == "") { $code = "409"; $msg = "error:UserName or password can not be empty!"; $data = "null"; $result = api_response::api_method($type, $code, $msg, $data); return $result; } else { $sql = "select*from users where UserName='******'"; $row = new dbconnect(); $row = $row->connect($sql); if (empty($row)) { $code = "404"; $msg = "error:The user does not exist!"; $data = "null"; $result = api_response::api_method($type, $code, $msg, $data); } else { $sql = "select*from users where UserName='******'&& PassWord='******' "; //$row=dbconnect::getInstance()->connect($sql); $row = new dbconnect(); $row = $row->connect($sql); $data = array('id' => "{$row['id']}", 'UserID' => "{$row['UserName']}", 'openid' => "{$row['openid']}", 'nickname' => "{$row['nickname']}", 'headimgurl' => "{$row['headimgurl']}", 'sex' => "{$row['sex']}", 'mobile' => "{$row['mobile']}"); if (empty($row)) { $code = "403"; $msg = "error:Incorrect password!"; $data = "null"; $result = api_response::api_method($type, $code, $msg, $data); } else { $code = "200"; $msg = "success!"; define("STR_MD", "23nbhjfdb#%#^A!~"); $status = md5($row['UserName'] . $row['PassWord'] . STR_MD . time()); $UserName = $row['UserName']; $result = new status(); $result->login_info($UserName, $status, $appID); $result = api_response::api_method($type, $code, $msg, $data); } } return $result; } }
public function get($table, $filter) { $this->query(status::lang(), "SELECT", $table, "", $filter); /* while ($entry = $this->fetch()) { echoall($entry); }*/ return $this->fetch(); }
public function page($page, $template) { if ($page->structure()) { // set parameters for stylesheet display $template->stylesheet->setParameter("", "lang", status::lang()); $template->stylesheet->setParameter("", "user", status::OLIV_USER()); // start stylesheet processor return $template->stylesheet->transformToXML($page->structure()); } }
/** * Save the video status * @return void */ public function save() { // save the parent object and thus the status table parent::save(); // grab the newly inserted status ID $id = $this->getID(); // insert into the video status table, using the same ID $extended = array(); $extended['id'] = $id; $extended['video_id'] = $this->video_id; $this->registry->getObject('db')->insertRecords('statuses_videos', $extended); }
public static function __callStatic($method, $options) { $content = $options[0]; $tag = $options[1]; //------------------------------------------------------------------------------ // look for href expressions $nodes = $content->XPath("//*[@href]"); // loop through all nodes for ($i = 0; $i < count($nodes); $i++) { // if not extern link // route if (!link_is_extern($href = (string) $nodes[$i]['href'])) { // set lang for link call if (!($lang = (string) $nodes[$i]['lang'])) { $lang = status::lang(); } $href = str_replace(array(";"), array("&"), $href); $hrefArray = explode(":", $href); // parse special route functions: // referer() ... insert referer address // current() ... insert current url and val // javascript(): ... convert to javascript call // urlName:valName ... convert to correct friendly_url/val switch ($hrefArray[0]) { case 'href()': $nodes[$i]['href'] = OLIVRoute::url($lang, $hrefArray[1], (string) $nodes[$i]["val"]); break; case 'referer()': $nodes[$i]['href'] = status::oliv_referer(); break; case 'current()': $nodes[$i]['href'] = OLIVRoute::url($lang, status::url(), status::val()); // insert additional parameters if (count($hrefArray) > 1) { $nodes[$i]['href'] = substr($nodes[$i]['href'], 0, -1) . "?" . $hrefArray[1]; } break; case 'javascript()': $nodes[$i]['href'] = "javascript:toolbox('" . (string) $hrefArray[1] . "')"; break; default: $nodes[$i]['href'] = OLIVRoute::url($lang, $hrefArray[0], status::val()); // add value if (count($hrefArray) > 1) { $nodes[$i]['href'] .= $hrefArray[1] . "/"; } break; } } } return $content; }
public function header() { $base = system::OLIV_PROTOCOL() . system::OLIV_HOST() . system::OLIV_BASE(); $o = "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>"; // set page to utf-8 $o .= "<base href='{$base}'>"; // link base referenz $o .= "<title>" . status::oliv_page() . "</title>"; // page title in browser $o .= "<link href='" . OLIVImage::_(system::OLIV_ICON()) . "' type='image/x-icon' rel='shortcut icon'>"; // icon in browser return $o; }
/** * Save the link status * @return void */ public function save() { // save the parent object and thus the status table parent::save(); // grab the newly inserted status ID $id = $this->getID(); // insert into the link status table, using the same ID $extended = array(); $extended['id'] = $id; $extended['URL'] = $this->url; $extended['description'] = $this->description; $this->registry->getObject('db')->insertRecords('statuses_links', $extended); }
/** * Retorna a consulta de um unidademedida pelo id * @return object [unidademedidaModel] */ public function consultar(unidadeMedidaModel $unidade_medida) { $this->db->clear(); $this->db->setTabela('unidade_medida'); $this->db->setCondicao("id_unidade_medida = '" . $unidade_medida->getId() . "'"); $this->db->select(); //unidademedida if ($this->db->rowCount() > 0) { $result = $this->db->result(); $unidade_medida->setNome($result['nome_unidade_medida']); $unidade_medida->setStatus(status::getAttribute($result['status_unidade_medida'])); return $unidade_medida; } else { return $unidademedidaModel; } }
/** * Retorna a consulta de um marcas pelo id * @return object [marcasModel] */ public function consultar(marcasModel $marca) { $this->db->clear(); $this->db->setTabela('marcas'); $this->db->setCondicao("id_marca = '" . $marca->getId() . "'"); $this->db->select(); //MARCAS if ($this->db->rowCount() > 0) { $result = $this->db->result(); $marca->setNome($result['nome_marca']); $marca->setStatus(status::getAttribute($result['status_marca'])); return $marca; } else { return $marca; } }
/** * Retorna a consulta de um categorias pelo id * @return object [categoriasModel] */ public function consultar(categoriasModel $categoria) { $this->db->clear(); $this->db->setTabela('categorias'); $this->db->setCondicao("id_categoria = '" . $categoria->getId() . "'"); $this->db->select(); //CATEGORIAS if ($this->db->rowCount() > 0) { $result = $this->db->result(); $categoria->setNome($result['nome_categoria']); $categoria->setStatus(status::getAttribute($result['status_categoria'])); return $categoria; } else { return $categoriasModel; } }
public function __construct($header) { // create temporary content xml // name different if used with different templates $templateName = (string) $header->param->template; if ($templateName) { $this->content = new simpleXmlElement("<search_{$templateName}/>"); } else { $this->content = new simpleXmlElement("<search/>"); } $tempContent = OLIVModule::load_content($header); $this->template = OLIVModule::load_template($header); olivxml_insert($this->content, $tempContent); olivxml_insert($this->content->search_result, status::search_result()); // add search result target page $this->content->target = $header->param->target; }
public static function __callStatic($method, $options) { $content = $options[0]; $tag = $options[1]; switch ($tag) { case 'form': // get form information $nodes = $content->XPath("//form"); // loop through all nodes for ($i = 0; $i < count($nodes); $i++) { $formMethod = $nodes[$i]["action"]; $nodes[$i]["method"] = "post"; $nodes[$i]["accept-charset"] = "utf-8"; // if no action -> insert correct url if (!$formMethod) { $nodes[$i]["action"] = OLIVRoute::makeUrl(status::lang(), status::url()); } else { $nodes[$i]["action"] = OLIVRoute::makeUrl(status::lang(), (string) $formMethod); } } break; case 'input': // if $xxx in value of input tag // replace by argv::xxx() value $nodes = $content->XPath("//input[contains(@value,'\$')]"); foreach ($nodes as $entry) { if ($entry) { $val = substr((string) $entry['value'], 1); $entry['value'] = argv::$val(); } } // set checked value for radio and checkbox $nodes = $content->XPath("//input[@type = 'radio' or @type = 'checkbox']"); foreach ($nodes as $entry) { $name = (string) $entry['name']; $value = (string) $entry['value']; $arg = argv::$name(); if ($arg == $value) { $entry['checked'] = "checked"; } } break; } return $content; }
public function consultar(IUsuarios $iusuario, usuariosModel $usuario, $status) { $result = $iusuario->consultar($this->db, $usuario, $status); if ($result != null) { //niveis de acesso $nivelAcessoModel = new niveisAcessoModel(); $nivelAcessoModel->setId($result['id_nivel_acesso']); //usuarios $usuariosModel = new usuariosModel(); $usuariosModel->setId($result['id_usuario']); $usuariosModel->setNivelAcesso($nivelAcessoModel); $usuariosModel->setLogin($result['login_usuario']); $usuariosModel->setEmail($result['email_usuario']); $usuariosModel->setStatus(status::getAttribute($result['status_usuario'])); $funcionariosModel = new funcionariosModel(); $funcionariosModel->setId($result['id_funcionario']); $usuariosModel->setFuncionario($funcionariosModel); return $usuariosModel; } else { return null; } }
public function process($page) { $content = $page->structure(); if ($content) { $lang = status::lang(); $default_lang = system::OLIV_DEFAULT_LANG(); $texts = $content->XPath("//*/*[text]"); // translate all texts for ($i = 0; $i < count($texts); $i++) { $text = OLIVText::xml($texts[$i]); // set correct language in node if (is_array($texts)) { if (array_key_exists($i, $texts)) { if ($texts[$i]->text) { unset($texts[$i]->text); $texts[$i]->text = $text; } } } } } //echoall($content); }
function __construct($header) { $this->content = OLIVModule::load_content($header); $pathActive = count(status::path()); // get path if (array_key_exists("path", $_SESSION)) { $path = $_SESSION['path']; } else { $path = array(); } // insert start page link if not active if ($path[0] != system::OLIV_INDEX_PAGE()) { $homePage = OLIVRoute::translateName(status::lang(), system::OLIV_INDEX_PAGE()); $newNode = $this->content->addChild("path_point", $homePage); $newNode->addAttribute("href", system::OLIV_INDEX_PAGE()); if ($pathActive == 0) { $newNode->addAttribute("class", "breadcrumb_active"); } else { $newNode->addAttribute("class", "breadcrumb"); } } // insert all links in hyrarchy $x = 1; foreach ($path as $page) { $pageName = OLIVRoute::translateName(status::lang(), $page); $newNode = $this->content->addChild("path_point", $pageName); $newNode->addAttribute("href", $page); if ($pathActive == $x) { $newNode->addAttribute("class", "breadcrumb_active"); } else { $newNode->addAttribute("class", "breadcrumb"); } $x++; } //echoall($this->content); $this->template = OLIVModule::load_template($header); }
function versions() { $stat = new status(); $stat->BuildNewersions(); }
$onlineMessage = "This is good, very good."; // Message below "It's Online" text $onlineReload = "It's Good, Reload Anyway?"; // Text for online reload button $offlineMessage = "Something must be wrong, this is not good at all."; // Message below "It's offline" text $offlineReload = "Try Again?"; // Text for offline reload button $theShortURL = 'http://goo.gl/JZjs8V'; // URL that will be shared when people click share on twitter of google+ buttons /* You should probably stop editing now. Only edit stuff after this if you know what you're doing. */ include 'thestuff.php'; include 'arh.php'; $headers = apache_request_headers(); $real_client_ip = $headers["X-Forwarded-For"]; $status = new status(); $getStuff = $status->performAction($apiurl, $apikey, $apihash, "status"); $statusMessage = $getStuff['statusmsg']; $memory = explode(",", $getStuff['mem']); $totalMem = $status->formatBytes($memory[0]); $usedMem = $status->formatBytes($memory[1]); $availMem = $status->formatBytes($memory[2]); $memPercent = round($memory[1] / $memory[0] * 100, 0); $disk = explode(",", $getStuff['hdd']); $totalDisk = $status->formatBytes($disk[0]); $usedDisk = $status->formatBytes($disk[1]); $availDisk = $status->formatBytes($disk[2]); $diskPercent = round($disk[1] / $disk[0] * 100, 0); $bandwidth = explode(",", $getStuff['bw']); $totalBW = $status->formatBytes($bandwidth[0]); $usedBW = $status->formatBytes($bandwidth[1]);
/** * Listagem dos módulos */ public function listar($id_modulo = 0) { $this->load->model('configuracoes/modulos/modulosModel'); $this->load->model('configuracoes/modulos/paginasModel'); $this->load->model('configuracoes/modulos/actionsModel'); $modulo = $this->getSubModulos($id_modulo); foreach ($modulo as $mod) { $modulosModel = new modulosModel(); $modulosModel->setId($mod['id_modulo']); $modulosModel->setNome($mod['nome_modulo']); $modulosModel->setUrl($mod['url_modulo']); $modulosModel->setIcone($mod['icone_modulo']); $modulosModel->setStatus(status::getAttribute($mod['status_modulo'])); $modulosModel->setStatus_selecao(status::getAttribute($mod['status_selecao_modulo'])); $submodulo = $this->getSubModulos($modulosModel->getId()); //pegando os submodulos foreach ($submodulo as $submod) { $submodulosModel = new modulosModel(); $submodulosModel->setId($submod['id_modulo']); $submodulosModel->setNome($submod['nome_modulo']); $submodulosModel->setUrl($submod['url_modulo']); $submodulosModel->setStatus(status::getAttribute($submod['status_modulo'])); $submodulosModel->setStatus_selecao(status::getAttribute($submod['status_selecao_modulo'])); //pegando as páginas $paginasModulo = $this->getPaginas($submodulosModel->getId()); foreach ($paginasModulo as $pagina) { $paginasModel = new paginasModel(); $paginasModel->setId($pagina['id_pagina']); $paginasModel->setNome($pagina['nome_pagina']); $paginasModel->setUrl($pagina['url_pagina']); $paginasModel->setStatus(status::getAttribute($pagina['status_pagina'])); $paginasModel->setStatus_Selecao(status::getAttribute($pagina['status_selecao_pagina'])); //pegando as actions $acoes = $this->getAcoes($paginasModel->getId()); foreach ($acoes as $acao) { $actionsModel = new actionsModel(); $actionsModel->setId($acao['id_action']); $actionsModel->setNome($acao['nome_action']); $actionsModel->setUrl($acao['url_action']); $actionsModel->setStatus(status::getAttribute($acao['status_action'])); $actionsModel->setStatus_selecao(status::getAttribute($acao['status_selecao_action'])); $paginasModel->addAction($actionsModel); } $submodulosModel->addPagina($paginasModel); } $modulosModel->addModulo($submodulosModel); } //pegando paginas $auxPag = array(); $paginasModulo = $this->getPaginas($modulosModel->getId()); foreach ($paginasModulo as $pagina) { $paginasModel = new paginasModel(); $paginasModel->setId($pagina['id_pagina']); $paginasModel->setNome($pagina['nome_pagina']); $paginasModel->setUrl($pagina['url_pagina']); $paginasModel->setStatus(status::getAttribute($pagina['status_pagina'])); $paginasModel->setStatus_selecao(status::getAttribute($pagina['status_selecao_pagina'])); $acoes = $this->getAcoes($pagina['id_pagina']); foreach ($acoes as $acao) { $actionsModel = new actionsModel(); $actionsModel->setId($acao['id_action']); $actionsModel->setNome($acao['nome_action']); $actionsModel->setUrl($acao['url_action']); $actionsModel->setStatus(status::getAttribute($acao['status_action'])); $actionsModel->setStatus_selecao(status::getAttribute($acao['status_selecao_action'])); $paginasModel->addAction($actionsModel); } $modulosModel->addPagina($paginasModel); } array_push($this->tree, $modulosModel); } return $this->tree; }
public function draw() { $display = ""; $o = "<ul id='" . $this->context->attributes()->name . "' class='contextMenu'>"; // create ouput string from xml foreach ($this->context as $entry) { // disable entry if ($display = (string) $entry->attributes()->display) { $display = " " . $display; } // set entry to url or status::url if (($url = (string) $entry->attributes()->url) == "#CURRENT") { $url = status::url(); } // set val if ($val = (string) $this->context->attributes()->value) { } else { $val = (string) $this->context->attributes()->name; } // set parameters $class = (string) $entry->attributes()->class; $cmd = (string) $entry->attributes()->cmd; $command = OLIVText::_($cmd); $text = OLIVText::_($entry->getName()); $o .= "<li class='{$class}{$display}'>"; $o .= "<a href='#{$cmd};{$command};" . OLIVRoute::url("", array("url" => $url)) . ";{$val}'>{$text}</a>"; $o .= "</li>"; } $o .= "</ul>"; // output to display echo $o; }
} else { $temp = preg_replace($pattern_ifgp,"",$temp); } $temp_text = preg_replace($pattern1,$str1_text,$match_text); $str.= preg_replace("/<{(.*?)}>/e","$$1",$temp); $str_text.= preg_replace("/<{(.*?)}>/e","$$1",$temp_text); }//i loop //mainloop ends here $val['today'] = date("d/m/Y"); $file = preg_replace($pattern,$str,$file); if($str=="") { $file = preg_replace("/\<form(.*?)\/form\>/s","<center>$err[cEmptyrecords]</center>",$file); } $file = $common->direct_replace($db_object,$file,$val); echo $file; $file_text = preg_replace($pattern,$str_text,$file_text); $file_text = $common->direct_replace($db_object,$file_text,$val); fwrite($fp,$file_text); fclose ($fp); }//end view }//end class $ob = new status; $ob->view_form($db_object,$common,$user_id,$default,$error_msg,$post_var); include_once("footer.php"); ?>
/** * Retorna a consulta de um produto * @return object [produtosModel] */ public function consultar(IConsultaProduto $consultaProduto, produtosModel $produto, $status) { try { $result = $consultaProduto->consultar($this->db, $produto, $status); if ($result != null) { $produto = new produtosModel(); //CATEGORIA $this->load->model('produtos/categoriasModel'); $categoriasModel = new categoriasModel(); $categoriasModel->setId($result['id_categoria']); $categoriasModel->setNome($result['nome_categoria']); $categoriasModel->setStatus(status::getAttribute($result['status_categoria'])); $categoriasModel->setDataCadastro($result['data_cadastro_categoria']); //MARCA $this->load->model('produtos/marcasModel'); $marcasModel = new marcasModel(); $marcasModel->setId($result['id_marca']); $marcasModel->setNome($result['nome_marca']); $marcasModel->setStatus(status::getAttribute($result['status_marca'])); $marcasModel->setDataCadastro($result['data_cadastro_marca']); //PRODUTO $produto->setId($result['id_produto']); $produto->setFoto($result['foto_produto']); $produto->setCodigoBarra($result['codigo_barra_gti']); $produto->setNome($result['nome_produto']); $produto->setMarca($marcasModel); $produto->setCategoria($categoriasModel); $produto->setDescricao($result['descricao_produto']); $produto->setStatus(status::getAttribute($result['status_produto'])); $produto->setDataCadastro($result['data_cadastro_produto']); if ((bool) $result['data_validade_controlada']) { $produto->ativarControleValidade(); } else { $produto->desativarControleValidade(); } $this->consultaUnidadesMedida($produto); return $produto; } else { return NULL; } } catch (dbException $e) { return $e->getMessageError(); } }
function js() { $page = CurrentPageName(); $tpl = new templates(); $st = new status(); $count = $st->squid_get_current_users_count(); $title = $tpl->_ENGINE_parse_body("{$count}»{member}"); $html = "YahooWin5('713','{$page}?popup=yes','{$title}')"; echo $html; }