0){ $row = mysqli_fetch_array($sql); $help = $row['help']; } if ($admin_type == 0 && isset($_COOKIE['edithelp'])) { return ' '.(empty($title) ? '(?)' : '').''; } elseif ($help != '') { return ' '.(empty($title) ? '(?)' : '').''; } } // Prikazemo zavihek z nastavitvami vprasajckov public static function displaySettings(){ global $lang; // Vklop / izklop urejanja vprasajckov echo '
'; echo ' ' . $lang['help_settings_activate_editing'] . ''; echo '

' . $lang['help_settings_activate_editing'] . ' '.Help::display('srv_window_help').':

'; self::editToggle(); echo '
'; // Urejanje vseh vprasajckov echo '
'; echo ' ' . $lang['help_settings_list'] . ''; self::editVprasajcki(); echo '
'; } // vkljuci izkljuci editiranje helpa private static function editToggle () { global $lang; if (isset($_COOKIE['edithelp'])) { echo '
'; echo ''; echo '
'; } else { echo '
'; echo ''; echo '
'; } } // Izpise seznam vprasajckov za urejanje private static function editVprasajcki () { global $lang; $sql = sisplet_query("SELECT * FROM srv_help h LEFT JOIN users u ON u.id=h.last_edit_usr_id WHERE h.lang='".$lang['id']."' ORDER BY h.last_edit_time DESC, h.what ASC "); while($row = mysqli_fetch_array($sql)){ echo '
'; echo '
'; echo $row['what'].' '.self::display($row['what']); echo '
'; echo 'Zadnje urejanje:
'.date('d.m.Y, H:i', strtotime($row['last_edit_time'])); if($row['email'] != '') echo '
('.$row['email'].')'; echo '
'; echo '
'; echo '
'; echo ' '; echo '
'; echo '
'; echo ' '; echo '
'; echo '
'; } } function ajax () { if ($_GET['a'] == 'edit_on') { $this->ajax_edit_on(); } elseif ($_GET['a'] == 'edit_off') { $this->ajax_edit_off(); } elseif ($_GET['a'] == 'display_edit_help') { $this->ajax_display_edit_help(); } elseif ($_GET['a'] == 'save_help') { $this->ajax_save_help(); } elseif ($_GET['a'] == 'display_help') { $this->ajax_display_help(); } } /** * @desc vklopi editiranje helpa (nastavi cooike) */ function ajax_edit_on () { setcookie('edithelp', 'on'); header("Location: index.php?a=nastavitve&m=help_settings"); } /** * @desc izklopi editiranje helpa (nastavi cooike) */ function ajax_edit_off () { setcookie('edithelp', '', time()-3600); header("Location: index.php?a=nastavitve&m=help_settings"); } /** * @desc prikaze formo za urejanje helpa */ function ajax_display_edit_help () { global $lang; $l = (int)$_GET['lang']; $what = substr($_REQUEST['what'], 5); $sql = sisplet_query("SELECT help FROM srv_help WHERE what = '$what' AND lang='$l'"); $row = mysqli_fetch_array($sql); echo ''; echo ''; } /** * @desc shrani help */ function ajax_save_help () { global $global_user_id; $l = (int)$_GET['lang']; $what = $_REQUEST['what']; $help = $_POST['help']; sisplet_query("REPLACE INTO srv_help (what, lang, help, last_edit_usr_id) VALUES ('".$what."', '".$l."', '".$help."', '".$global_user_id."')"); } function ajax_display_help() { $l = (int)$_GET['lang']; $what = substr($_REQUEST['what'], 5); $sql = sisplet_query("SELECT help FROM srv_help WHERE what = '$what' AND lang='$l'"); $row = mysqli_fetch_array($sql); echo '
'.nl2br($row['help']).'
'; } } ?>