function showMethods($tmpl_id = false) { if (!$tmpl_id) { $tmpl_id = params::get('tmpl_id'); } conf::parse('tmpls', $tmpl_id); $array = conf::get('tmpls', 'methods'); if (!$array) { buffer::setTmpl(); } foreach ($array as $v) { $arr = explode('::', $v); if (!isset($arr[1])) { buffer::setTmpl(); return false; } s::roll('methods', array('app' => $arr[0], 'module' => $arr[1], 'action' => $arr[2])); } }
function showEvents($menu_id = false) { if (!$menu_id) { $menu_id = params::get('menu_id'); } conf::parse('menus', $menu_id); $array = conf::get('menus', 'events'); if (!$array) { buffer::setTmpl(); } foreach ($array as $v) { $arr = explode('::', $v); if (!isset($arr[1])) { buffer::setTmpl(); return false; } switch ($arr[3]) { case 'hide': s::roll('events', array('event_t' => $v, 'type' => $arr[3], 'mode' => $arr[0], 'name' => $arr[1], 'value' => $arr[2])); break; case 'replace': s::roll('events', array('event_t' => $v, 'type' => $arr[3], 'mode' => $arr[0], 'name' => $arr[1], 'value' => $arr[2], 'action' => appMenus::getMenuName($arr[4]))); break; } } }
function showSection() { $section_id = web::getThis(); $item_id = web::getEvent(); if ($item_id !== false) { buffer::setTmpl('card.html'); self::showCard($item_id, $section_id); return false; } $dir = IMAGES_ROOT . 'sections/'; $dir_path = IMAGES_PATH . 'sections/'; db::table('catalog_sections'); db::where('section_id', $section_id); $section = db::assoc(); if (db::rows() == 0) { web::error404(); } s::set($section); s::set('page_title', $section['section_name']); s::set('page_header', $section['section_name']); $file = $dir . $section['section_id'] . '.jpg'; if (file_exists($file)) { s::set('section_img', '<img src="' . $dir_path . $section['section_id'] . '.jpg' . '" />'); } db::table('catalog_items'); db::where('section_id', $section_id); $r = db::select('item_name', 'item_id', 'item_desc'); $i = 0; while ($a = mysql_fetch_assoc($r)) { $i++; if ($i % 2) { s::roll('items1', $a); } else { s::roll('items2', $a); } } }
function showEvents($block_id = false) { if (!$block_id) { $block_id = params::get('block_id'); } conf::parse('blocks', $block_id); $array = conf::get('blocks', 'events'); if (!$array) { buffer::setTmpl(); } foreach ($array as $v) { $arr = explode('::', $v); if (!isset($arr[1])) { buffer::setTmpl(); return false; } switch ($arr[3]) { case 'hide': s::roll('events', array('event_t' => $v, 'type' => $arr[3], 'mode' => $arr[0], 'name' => $arr[1], 'value' => $arr[2])); break; case 'show': s::roll('events', array('event_t' => $v, 'type' => $arr[3], 'mode' => $arr[0], 'name' => $arr[1], 'value' => $arr[2])); break; case 'replace': s::roll('events', array('event_t' => $v, 'type' => $arr[3], 'mode' => $arr[0], 'name' => $arr[1], 'value' => $arr[2], 'action' => '{!' . appBlocks::getBlockName($arr[4]) . '}')); break; case 'handler': s::roll('events', array('event_t' => $v, 'type' => $arr[3], 'mode' => $arr[0], 'name' => $arr[1], 'value' => $arr[2], 'action' => implode('::', array($arr[4], $arr[5], $arr[6])))); break; } } }
function showEvents($page_id = false) { if (!$page_id) { $page_id = params::get('page_id'); } conf::parse('pages', $page_id); $array = conf::get('pages', 'events'); if (!$array) { buffer::setTmpl(); } foreach ($array as $v) { $arr = explode('::', $v); if (!isset($arr[1])) { buffer::setTmpl(); return false; } switch ($arr[3]) { case 'hide': s::roll('events', array('event_t' => $v, 'type' => $arr[3], 'mode' => $arr[0], 'name' => $arr[1], 'value' => $arr[2])); break; case 'replace': s::roll('events', array('event_t' => $v, 'type' => $arr[3], 'mode' => $arr[0], 'name' => $arr[1], 'value' => $arr[2], 'action' => appPages::getPage($arr[4], 'page_title'))); break; case 'handler': s::roll('events', array('event_t' => $v, 'type' => $arr[3], 'mode' => $arr[0], 'name' => $arr[1], 'value' => $arr[2], 'action' => implode('::', array($arr[4], $arr[5], $arr[6])))); break; } } }