Update of /cvsroot/phpwebapp/web_app/boxes/menu/edit
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23863/boxes/menu/edit
Modified Files:
edit_menu.php
Log Message:
small improvments
Index: edit_menu.php
===================================================================
RCS file: /cvsroot/phpwebapp/web_app/boxes/menu/edit/edit_menu.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** edit_menu.php 22 Jul 2004 16:25:38 -0000 1.2
--- edit_menu.php 9 Jun 2005 13:07:34 -0000 1.3
***************
*** 38,55 ****
function transform_menu($transformer, $arr_params =array())
{
- //apply the transformer and get the new menu
- $new_menu = $this->transform($transformer, $arr_params);
-
- //save the transformed menu to a tmp file
- $tmpfname = tempnam("/tmp", "menu");
- $fp = fopen($tmpfname, 'w');
- fputs($fp, $new_menu);
- fclose($fp);
-
- //move to menu.xml and set permissions
$menu_xml = MENU.'edit/menu.xml';
! shell_exec("./wrapper mv $tmpfname $menu_xml");
! shell_exec("./wrapper chown dasho.dasho $menu_xml");
! shell_exec("./wrapper chmod 664 $menu_xml");
}
--- 38,44 ----
function transform_menu($transformer, $arr_params =array())
{
$menu_xml = MENU.'edit/menu.xml';
! $new_menu = $this->transform($transformer, $arr_params);
! write_file($menu_xml, $new_menu);
}
***************
*** 138,170 ****
function on_apply($event_args)
{
! $menu_xml = MENU.'menu.xml';
$edit_menu_xml = MENU.'edit/menu.xml';
! shell_exec("./wrapper cp $edit_menu_xml $menu_xml");
! //get menu_items.js
! $menu_items = $this->transform('menu_items.xsl');
! //save it to a tmp file
! $tmpfname = tempnam("/tmp", "menu");
! $fp = fopen($tmpfname, 'w');
! fputs($fp, $menu_items);
! fclose($fp);
! //move to menu_items.js and set permissions
$menu_items_js = MENU.'menu_items.js';
! shell_exec("./wrapper mv $tmpfname $menu_items_js");
! shell_exec("./wrapper chown dasho.dasho $menu_items_js");
! shell_exec("./wrapper chmod 664 $menu_items_js");
! //get book_list.php
! $book_list = $this->transform('book_list.xsl');
! //save it to a tmp file
! $tmpfname = tempnam("/tmp", "menu");
! $fp = fopen($tmpfname, 'w');
! fputs($fp, $book_list);
! fclose($fp);
! //move to book_list_php and set permissions
$book_list_php = MENU.'book_list.php';
! shell_exec("./wrapper mv $tmpfname $book_list_php");
! shell_exec("./wrapper chown dasho.dasho $book_list_php");
! shell_exec("./wrapper chmod 664 $book_list_php");
}
--- 127,144 ----
function on_apply($event_args)
{
! //update menu.xml
$edit_menu_xml = MENU.'edit/menu.xml';
! $menu_xml = MENU.'menu.xml';
! shell("cp $edit_menu_xml $menu_xml");
! //update menu_items.js
$menu_items_js = MENU.'menu_items.js';
! $menu_items = $this->transform('menu_items.xsl');
! write_file($menu_items_js, $menu_items);
! //update book_list.php
$book_list_php = MENU.'book_list.php';
! $book_list = $this->transform('book_list.xsl');
! write_file($book_list_php, $book_list);
}
***************
*** 174,178 ****
$menu_xml = MENU.'menu.xml';
$edit_menu_xml = MENU.'edit/menu.xml';
! shell_exec("./wrapper cp $menu_xml $edit_menu_xml");
}
--- 148,152 ----
$menu_xml = MENU.'menu.xml';
$edit_menu_xml = MENU.'edit/menu.xml';
! shell("cp $menu_xml $edit_menu_xml");
}
|