| 
      1
     | 
    
      <?php
 
     | 
  
  
    | 
      2
     | 
    
      
 
     | 
  
  
    | 
      3
     | 
    
      // $Id: jsadmin.php 915 2009-01-21 19:27:01Z Ruebenwurzel $
 
     | 
  
  
    | 
      4
     | 
    
      
 
     | 
  
  
    | 
      5
     | 
    
      // JsAdmin module for Website Baker
 
     | 
  
  
    | 
      6
     | 
    
      // Copyright (C) 2006, Stepan Riha
 
     | 
  
  
    | 
      7
     | 
    
      // www.nonplus.net
 
     | 
  
  
    | 
      8
     | 
    
      
 
     | 
  
  
    | 
      9
     | 
    
      // modified by Swen Uth for Website Baker 2.7
 
     | 
  
  
    | 
      10
     | 
    
      
 
     | 
  
  
    | 
      11
     | 
    
      /*
 
     | 
  
  
    | 
      12
     | 
    
      
 
     | 
  
  
    | 
      13
     | 
    
       Website Baker Project <http://www.websitebaker.org/>
 
     | 
  
  
    | 
      14
     | 
    
       Copyright (C) 2004-2009, Ryan Djurovich
 
     | 
  
  
    | 
      15
     | 
    
      
 
     | 
  
  
    | 
      16
     | 
    
       Website Baker is free software; you can redistribute it and/or modify
 
     | 
  
  
    | 
      17
     | 
    
       it under the terms of the GNU General Public License as published by
 
     | 
  
  
    | 
      18
     | 
    
       the Free Software Foundation; either version 2 of the License, or
 
     | 
  
  
    | 
      19
     | 
    
       (at your option) any later version.
 
     | 
  
  
    | 
      20
     | 
    
      
 
     | 
  
  
    | 
      21
     | 
    
       Website Baker is distributed in the hope that it will be useful,
 
     | 
  
  
    | 
      22
     | 
    
       but WITHOUT ANY WARRANTY; without even the implied warranty of
 
     | 
  
  
    | 
      23
     | 
    
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
     | 
  
  
    | 
      24
     | 
    
       GNU General Public License for more details.
 
     | 
  
  
    | 
      25
     | 
    
      
 
     | 
  
  
    | 
      26
     | 
    
       You should have received a copy of the GNU General Public License
 
     | 
  
  
    | 
      27
     | 
    
       along with Website Baker; if not, write to the Free Software
 
     | 
  
  
    | 
      28
     | 
    
       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     | 
  
  
    | 
      29
     | 
    
      
 
     | 
  
  
    | 
      30
     | 
    
      */
 
     | 
  
  
    | 
      31
     | 
    
      
 
     | 
  
  
    | 
      32
     | 
    
      function get_setting($name, $default = '') {
     | 
  
  
    | 
      33
     | 
    
      	global $database;
 
     | 
  
  
    | 
      34
     | 
    
      	$rs = $database->query("SELECT value FROM ".TABLE_PREFIX."mod_jsadmin WHERE name = '".$name."'");
     | 
  
  
    | 
      35
     | 
    
      	if($row = $rs->fetchRow())
 
     | 
  
  
    | 
      36
     | 
    
      		return $row['value'];
 
     | 
  
  
    | 
      37
     | 
    
      	return
 
     | 
  
  
    | 
      38
     | 
    
      		$default;
 
     | 
  
  
    | 
      39
     | 
    
      }
 
     | 
  
  
    | 
      40
     | 
    
      
 
     | 
  
  
    | 
      41
     | 
    
      function save_setting($name, $value) {
     | 
  
  
    | 
      42
     | 
    
      	global $database;
 
     | 
  
  
    | 
      43
     | 
    
      
 
     | 
  
  
    | 
      44
     | 
    
      	$prev_value = get_setting($name, false);
 
     | 
  
  
    | 
      45
     | 
    
      
 
     | 
  
  
    | 
      46
     | 
    
      	if($prev_value === false) {
     | 
  
  
    | 
      47
     | 
    
      		$database->query("INSERT INTO ".TABLE_PREFIX."mod_jsadmin (name,value) VALUES ('$name','$value')");
     | 
  
  
    | 
      48
     | 
    
      	} else {
     | 
  
  
    | 
      49
     | 
    
      		$database->query("UPDATE ".TABLE_PREFIX."mod_jsadmin SET value = '$value' WHERE name = '$name'");
     | 
  
  
    | 
      50
     | 
    
      	}
 
     | 
  
  
    | 
      51
     | 
    
      }
 
     | 
  
  
    | 
      52
     | 
    
      
 
     | 
  
  
    | 
      53
     | 
    
      // the follwing variables to use and check existing the YUI
 
     | 
  
  
    | 
      54
     | 
    
      $WB_MAIN_RELATIVE_PATH="../..";
 
     | 
  
  
    | 
      55
     | 
    
      $YUI_PATH = '/include/yui';
 
     | 
  
  
    | 
      56
     | 
    
      $js_yui_min = "-min";  // option for smaller code so faster
 
     | 
  
  
    | 
      57
     | 
    
      $js_yui_scripts = Array();
 
     | 
  
  
    | 
      58
     | 
    
      $js_yui_scripts[] = $YUI_PATH.'/yahoo/yahoo'.$js_yui_min.'.js';
 
     | 
  
  
    | 
      59
     | 
    
      $js_yui_scripts[] = $YUI_PATH.'/event/event'.$js_yui_min.'.js';
 
     | 
  
  
    | 
      60
     | 
    
      $js_yui_scripts[] = $YUI_PATH.'/dom/dom'.$js_yui_min.'.js';
 
     | 
  
  
    | 
      61
     | 
    
      $js_yui_scripts[] = $YUI_PATH.'/connection/connection'.$js_yui_min.'.js';
 
     | 
  
  
    | 
      62
     | 
    
      $js_yui_scripts[] = $YUI_PATH.'/dragdrop/dragdrop'.$js_yui_min.'.js';
 
     | 
  
  
    | 
      63
     | 
    
      
 
     | 
  
  
    | 
      64
     | 
    
      ?>
 
     |