<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: cms_build.tpl.php,v 1.3 2013-12-02 09:07:25 dbellamy Exp $
if (stristr($_SERVER['REQUEST_URI'], "tpl.php")) {
    die("no access");
}
function cms_gen_objet_css($name)
{
    $objet_css = "\n\t<input dojoType='dijit.form.NumberSpinner' value='' smallDelta='1' constraints='{min:-2000,max:2000,places:0}' id='{$name}' name='{$name}' style= 'width:80px'\n\t\tintermediateChanges='true'\n\t \tonchange =\"cms_change_css(document.getElementById('cms_edit_form').getAttribute('cms_edit_id'));\"\n\t/>\n\t<select id='" . $name . "_def' name='" . $name . "_def' onchange =\"cms_change_css_format_number(this,'{$name}');cms_change_css(document.getElementById('cms_edit_form').getAttribute('cms_edit_id'));\">\t\t\t\t\n\t\t<option value='auto'>auto</option>\n\t\t<option value='px'>px</option>\n\t\t<option value='%'>%</option>\n\t\t<option value='inherit'>inherit</option>\n\t</select>\n\t";
    return $objet_css;
}
$cms_edit_css = "\n\t<script type='text/javascript'>\n\t\t\n\t\tfunction cms_change_css_format_number(obj,id_number){\n\t\t\tobj_number=document.getElementById(id_number);\n\t\t\tobj_number_field=document.getElementById('widget_'+id_number);\n\t\t\tswitch(obj.options[obj.selectedIndex].value){\n\t\t\t\tcase 'auto':\n\t\t\t\t\tobj_number_field.style.display='none';\n\t\t\t\tbreak;\n\t\t\t\tcase 'px': \n\t\t\t\t\tobj_number_field.style.display='block';\n\t\t\t\tbreak;\n\t\t\t\tcase '%': \n\t\t\t\t\tobj_number_field.style.display='block';\n\t\t\t\tbreak;\n\t\t\t\tcase 'inherit': \n\t\t\t\t\tobj_number_field.style.display='none';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\n\t    dojo.require('dijit.form.NumberSpinner');\n\t  \n\t</script>\n\t<div id='cms_edit_form' cms_edit_id='' >\n\t\t<h3>\n\t\t\t" . $msg["cms_edit_css"] . "\n\t\t</h3>\n\t\t<div class='row'>\n\t\t\t<span id='cms_edit_title_obj'>\n\t\t</span></div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_position"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<select id='cms_position' name='cms_position' onchange =\"cms_change_css(document.getElementById('cms_edit_form').getAttribute('cms_edit_id'));\">\t\t\t\t\n\t\t\t\t<option value='relative'>relative</option>\n\t\t\t\t<option value='absolute'>absolute</option>\n\t\t\t\t<option value='static'>static</option>\n\t\t\t</select>\n\t\t</div>\t\t\t\t\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_left"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_left") . "\t\t\t\n\t\t</div>\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_top"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_top") . "\t\t\t\n\t\t</div>\t\t\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_zindex"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_zIndex") . "\t\t\t\n\t\t</div>\t\t\t\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_visibility"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\t\t\t\n\t\t\t<select id='cms_visibility' name='cms_visibility' onchange =\"cms_change_css(document.getElementById('cms_edit_form').getAttribute('cms_edit_id'));\">\t\t\t\t\n\t\t\t\t<option value='hidden'>hidden</option>\n\t\t\t\t<option value='visible'>visible</option>\n\t\t\t</select>\n\t\t</div>\t\t\t\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_height"] . "&nbsp;</label>\t\t\t\n\t\t</div>\n\t\t<div class='row'>\t\t\t\n\t\t\t" . cms_gen_objet_css("cms_height") . "\t\t\t\n\t\t</div>\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_width"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\t\t\t\t\t\n\t\t\t" . cms_gen_objet_css("cms_width") . "\t\n\t\t</div>\t\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_float"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\t\t\t\t\t\n\t\t\t<select id='cms_float' name='cms_float' onchange =\"cms_change_css(document.getElementById('cms_edit_form').getAttribute('cms_edit_id'));\">\t\t\t\t\n\t\t\t\t<option value='left'>left</option>\n\t\t\t\t<option value='right'>right</option>\n\t\t\t\t<option value='none'>none</option>\n\t\t\t\t<option value='inherit'>inherit</option>\n\t\t\t</select>\n\t\t</div>\t\t\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_margin_top"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_margin_top") . "\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_padding_top"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_padding_top") . "\n\t\t</div>\t\n\t\t<div class='row'>\t\t\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_margin_right"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_margin_right") . "\n\t\t</div>\t\t\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_padding_right"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_padding_right") . "\n\t\t</div>\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_margin_bottom"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_margin_bottom") . "\n\t\t</div>\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_padding_bottom"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_padding_bottom") . "\n\t\t</div>\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_margin_left"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_margin_left") . "\n\t\t</div>\t\t\t\t\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_padding_left"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_padding_left") . "\n\t\t</div>\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_display"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\t\t\t\n\t\t\t<select id='cms_display' name='cms_display' onchange =\"cms_change_css(document.getElementById('cms_edit_form').getAttribute('cms_edit_id'));\">\t\t\t\t\n\t\t\t\t<option value='block'>block</option>\n\t\t\t\t<option value='none'>none</option>\n\t\t\t</select>\n\t\t</div>\t\n\t\t\n\t\t<div class='row'>\t\t\n\t\t\t<input type='button' class='bouton' name='cms_edit_form_save' id='cms_edit_form_save' value='" . $msg["cms_edit_form_save"] . "' onclick='' />\t\t\t\n\t\t</div>\t\n\t</div>\n";
$cms_objet_type_selection = "\n\t<h3>\n\t\t" . $msg["cms_edit_objet_selection"] . "\n\t</h3>\n\t<div class='row'>\n\t\n\t\t<table border='0'  width='100%' cellspacing='0'>\n\t\t<tr>\n\t\t\t<td>" . $msg["cms_dragable_type"] . "\t\t\n\t\t\t</td>\t\t\n\t\t\t<td>\n\t\t\t\t<input  type='radio' id='cms_dragable_cadre' name='cms_dragable_type' value='cadre' onclick=\"cms_drag_activate_form();\" ><label for='cms_dragable_cadre'>" . $msg["cms_dragable_zone"] . "</label>\n\t\t\t</td>\t\n\t\t\t<td>\t\t\n\t\t\t\t<input  type='radio' id='cms_dragable_object' name='cms_dragable_type' value='object'  checked='checked' onclick=\"cms_drag_activate_form();\" ><label for='cms_dragable_object'>" . $msg["cms_dragable_cadre"] . "</label>\n\t\t\t</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t" . $msg["cms_receptable_type"] . "\t\t\n\t\t\t</td>\t\t\n\t\t\t<td>\n\t\t\t\t<input  type='radio' id='cms_receptable_conteneur' name='cms_receptable_type' value='conteneur' onclick=\"cms_drag_activate_form();\" ><label for='cms_receptable_conteneur'>" . $msg["cms_receptable_conteneur"] . "</label>\n\t\t\t</td>\t\n\t\t\t<td>\t\t\n\t\t\t\t<input  type='radio' id='cms_receptable_cadre' name='cms_receptable_type'  value='cadre' checked='checked' onclick=\"cms_drag_activate_form();\" ><label for='cms_receptable_cadre'>" . $msg["cms_receptable_zone"] . "</label>\n\t\t\t</td>\n\t\t</tr>\t\n\t\t</table>\n\t</div>\t\n\t<div class='row'>\t\t\n\t\t<input type='button'  class='bouton'  id='cms_drag_activate_button' active='' value='" . $msg["cms_activer_drag_drop"] . "'  onclick=\"cms_drag_activate_form(); return false;\">\n\t</div>\t\n\t";
$cms_edit_objet = "\t\n\t<script type='text/javascript'>\n\t\n\t\tfunction cms_opac_loaded(){\n\t\t\tdocument.getElementById('cms_drag_activate_button').setAttribute('active','1')\n\t\t\tcms_drag_activate_form();\n\t\t}\n\t\tfunction cms_drag_activate_form(){\n\t\t\tif(document.getElementById('cms_drag_activate_button').getAttribute('active') ){\n\t\t\t\tcms_drag_activate(0,0,0);\n\t\t\t\tdocument.getElementById('cms_drag_activate_button').style.backgroundColor ='';\n\t\t\t\tdocument.getElementById('cms_drag_activate_button').setAttribute('active','')\n\t\t\t\tdocument.getElementById('cms_drag_activate_button').value='" . $msg["cms_activer_drag_drop"] . "';\n\t\t\t\treturn;\n\t\t\t} else{\n\t\t\t\tdocument.getElementById('cms_drag_activate_button').style.backgroundColor ='#00FF00';\n\t\t\t\tdocument.getElementById('cms_drag_activate_button').setAttribute('active','1')\n\t\t\t\tdocument.getElementById('cms_drag_activate_button').value='" . $msg["cms_reset_drag_drop"] . "';\n\t\t\t}\n\t\t\t\n\t\t\tvar radioButtons=document.getElementsByName('cms_dragable_type');\n\t\t\tvar cms_dragable_type=0;\n\t\t\tfor (var i=0; i < radioButtons.length; i ++) {\t           \n\t            if (radioButtons[i].checked) {\n                    cms_dragable_type=radioButtons[i].value;\n                }\n\t        } \n\t        \n\t\t\tvar radioButtons=document.getElementsByName('cms_receptable_type');\n\t\t\tvar cms_receptable_type=0;\n\t\t\tfor (var i=0; i < radioButtons.length; i ++) {\t           \n\t            if (radioButtons[i].checked) {\n                    cms_receptable_type=radioButtons[i].value;\n                }\n\t        } \t      \n\t        \n\t\t\tcms_drag_activate(1,cms_dragable_type,cms_receptable_type);\n\t\t}\n\t</script>\n\n\t\t\t\n\n";
$cms_build_cadres_tpl = "\n\t<script type='text/javascript'>\n\t\tvar cms_cadre_portail_list=new Array();\n\t\t!!cms_cadre_portail_list!!\n\t</script>\n\t<table>\n\t\t!!items!!\n\t</table>\n";
$cms_build_cadre_tpl_item = "\n<tr class='!!odd_even!!' style='cursor: pointer;' onmouseout=\"this.className='!!odd_even!!'\" onmouseover=\"this.className='surbrillance'\"\n \t\tonclick=\"cms_show_obj('!!cadre_object!!_!!id_cadre!!');return false; \" >\n\t<td>\t\t<a onclick=\"cms_build_load_module('!!cadre_object!!','get_form',!!id_cadre!!);\" href='#' > \n\t\t\t\t<img class='icon' width='16' height='16' title='" . $msg["cms_build_edit_bt"] . "' alt='" . $msg["cms_build_page_add_bt"] . "' src='./images/b_edit.png'  >\n\t\t\t</a>\t\n\t\t\t!!cadre_name!!\n\t</td>\t\t\t\n</tr>\n";
$cms_build_pages_tpl = "\n\n<script type='text/javascript'>\n    dojo.require('dijit.form.Button');\n    dojo.require('dijit.Dialog');    \n    dojo.require('dojo.parser');\n    dojo.require('dojox.layout.ContentPane');\n    dojo.require('dojox.widget.Dialog');\n    dojo.require('dojox.widget.DialogSimple');\n    \n    function cms_build_page_edit_add(id){\n    \n    \tif(!dijit.byId('cms_build_dialog')){\n\t        //creates a new dialog\n\t        try {\n\t        \tvar myDijit = new dojox.widget.DialogSimple({title: 'Referent', id:'cms_build_dialog'});    \n\t\t\t}catch(e){\n\t\t\t\tif(typeof console != 'undefined') {\n\t\t\t\t\tconsole.log(e);\n\t\t\t\t}\n\t\t\t};\n\t         \n\t        //appends the dialog to an existing DOM node\n\t        dojo.byId('att').appendChild(myDijit.domNode);\n\t        //the dialog is hidden until called\n\t\t}    \n        //get the dialog\n        var dialogDijit = dijit.byId('cms_build_dialog');        \n        var path = './ajax.php?module=cms&categ=pages&sub=edit&id='+id\n        dialogDijit.attr('href', path);\n        dialogDijit.show();\n\t}\n\n\t \n\tfunction cms_build_page_add(page){\t\n\t\tvar frame=document.getElementById('opac_frame')\n\t\tframe.setAttribute('src', '" . $opac_url_base . "index.php?cms_build_activate=1&lvl=cmspage&pageid='+page);\n\t\n\t}\n\t\n\t</script>\n\t<div id='cms_build_pages_list'>\n\t\t!!items!!\n\t</div>\n\t<input type='button' class='bouton' value='" . $msg["cms_build_page_add_bt"] . "' onclick=\"cms_build_page_edit_add('!!id!!'); return false;\">\n";
$cms_build_pages_tpl_item = "\n<a href='#' onclick=\"cms_build_page_edit_add('!!id!!');\"><img class='icon' width='16' height='16' title='" . $msg["cms_build_edit_bt"] . "' alt='" . $msg["cms_build_page_add_bt"] . "' src='./images/b_edit.png'> </a> \t\n<a href='#' onclick=\"cms_build_page_add('!!id!!');\">!!name!!</a> <br/>\n";
$cms_build_pages_ajax_tpl = "\n\t!!items!!\n";
$cms_build_modules_tpl = "\n  <script type='text/javascript'>\n        function cms_build_load_module(module,action,id){\n            if(!module.match('cms_module_')){\n                 module = 'cms_module_'+module;\n            }  \n                \n\t    \tif(!dijit.byId('cms_build_dialog')){\n\t\t        //creates a new dialog\n\t\t        try {\n\t\t        \tvar myDijit = new dojox.widget.DialogSimple({title: 'Referent', id:'cms_build_dialog'});    \n\t\t\t\t}catch(e){\n\t\t\t\t\tif(typeof console != 'undefined') {\n\t\t\t\t\t\tconsole.log(e);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t         \n\t\t        //appends the dialog to an existing DOM node\n\t\t        dojo.byId('att').appendChild(myDijit.domNode);\n\t\t        //the dialog is hidden until called\n\t\t\t}    \n\t        //get the dialog\n\t        var dialogDijit = dijit.byId('cms_build_dialog');        \n\t        var path = './ajax.php?module=cms&categ=module&elem='+module+'&action='+action+'&id='+id;\n\t        path+='&callback=window.parent.cms_build_save_module';\n\t        path+='&cancel_callback=window.parent.cms_build_cancel_module';\n\t        path+='&cms_build_info=' + parent.frames['opac_frame'].document.getElementById('cms_build_info').value;\n\t        dialogDijit.attr('href', path);\n\t        dialogDijit.show();            \n        }\n      \t\n        function cms_build_cancel_module(data){\n        \tdijit.byId('cms_build_dialog').hide(); \t\n        }\t\t        \n        \n        function cms_build_save_module(data){\n        \tdijit.byId('cms_build_dialog').hide(); \t\t\n\t\t\tcms_build_new_cadre(data.dom_id, data.name+' ( id='+data.id+' )<br/>'+data['object']);\n         }\n\t</script>\n\t!!items!!\n";
$cms_build_block_tpl = "\n<script src='./javascript/cms/cms_build.js'></script>\n<script src='./javascript/cms/cms_drag_n_drop.js'></script>\n<script src='./javascript/cms/cms_drop.js'></script>\n<script src='./javascript/cms/cms_pages.js'></script>\n\n<script type='text/javascript'>\n\tdojo.require('dojo.parser');\n\tdojo.require('dijit.layout.BorderContainer');\n\tdojo.require('dijit.layout.TabContainer');\n\tdojo.require('dijit.layout.AccordionContainer');\n\tdojo.require('dijit.layout.ContentPane');       \n</script>\n\t\n<div dojoType='dijit.layout.BorderContainer' design='sidebar' gutters='true' style='width: 100%; height: 800px;'>\n\t\n\t<div dojoType='dijit.layout.ContentPane'  region='center' >\n\t\t<IFRAME name='opac_frame' id='opac_frame' src='" . $opac_url_base . "index.php?cms_build_activate=1' style='background-color:#FFFFFF;width:100%;height:710px;border:0px solid #000'></IFRAME>\t\n\t</div>\n\t<div dojoType='dijit.layout.ContentPane' region='left' splitter='true' style='width:300px;' >\n\t\t\t\n\t\t  <div dojoType='dijit.layout.TabContainer' >\t\t\t  \n\t\t        <div dojoType='dijit.layout.ContentPane' title='" . $msg["cms_build_objet_content"] . "' selected='true'>\t\t\t           \n\t\t           \t\t   \n\t\t           <div dojoType= 'dijit.layout.AccordionContainer' >\t\t        \n\t\t\t\t       \t\n\t\t\t\t        <div dojoType= 'dijit.layout.AccordionPane' title='" . $msg["cms_build_objet_def"] . "' selected='true'>\n\t\t\t\t        \t{$cms_objet_type_selection}\n\t\t\t\t        \t{$cms_edit_objet}\n\t\t\t\t        \t<div class='row'>\n\t\t\t\t\t\t\t\t<h3>" . $msg["cms_edit_sel_objet_list"] . "</h3>\n\t\t\t\t\t\t\t\t</div>\t\t\n\t\t\t\t\t\t\t\t<div class='row' id='cms_edit_sel_objet_list'>\n\t\t\t\t\t\t\t\t\t<table id='cms_edit_sel_objet_list_table' border='0'  width='100%' cellspacing='0'>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t</div>\t\t\n\t\t\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t\t\t<h3>" . $msg["cms_edit_sel_portail_list"] . "</h3>\n\t\t\t\t\t\t\t\t</div>\t\t\n\t\t\t\t\t\t\t\t<div class='row' id='cms_edit_sel_portail_list'>\t\n\t\t\t\t\t\t\t\t\t!!cadre_portail_list!!\t\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t\t\t<h3>" . $msg["cms_edit_sel_cadre_list"] . "</h3>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class='row' id='cms_edit_sel_cadre_list'>\n\t\t\t\t\t\t\t\t\t<table id='cms_edit_sel_cadre_list_table' border='0'  width='100%' cellspacing='0'>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t</div>\t\t\t\n\t\t\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t        </div>\t\t\t\t\t\t\n\t\t\t\t        <div dojoType= 'dijit.layout.AccordionPane' title='" . $msg["cms_build_modules"] . "'>\t\n\t\t\t\t        \t!!cms_objet_modules!!\t\t\t\t\t\t          \n\t\t\t\t        </div>\t\t\n\t\t\t\t        <div dojoType= 'dijit.layout.AccordionPane' title='" . $msg["cms_build_pages"] . "'>\n\t\t\t\t        \t!!cms_objet_pages!!\t\t\t\t          \n\t\t\t\t        </div>\t\t\t\n\t\t      \t\t</div>\n\t\t        </div>\n\t\t        <div dojoType='dijit.layout.ContentPane' title='" . $msg["cms_build_css_content"] . "'>\n\t\t           {$cms_edit_css}\n\t\t        </div>\n\t\t    </div>\t\t\n\t</div>\n\t<div dojoType='dijit.layout.ContentPane' region='bottom' >\t\n\t\t<input type='button' class='bouton' value='" . $msg["cms_memoriser_drag_drop"] . "' onclick=\"cms_drag_record(); return false;\">\n\t</div>\n</div>\t\n\n<script type='text/javascript'>\n\tvar cms_contener_list=new Array();\n\tvar cms_zone_list=new Array();\n\tvar cms_objet_list=new Array();\n\t!!cms_objet_list_declaration!!\n\tcms_build_init();\t\n</script>\n";
Exemple #2
0
// +-------------------------------------------------+
// $Id: cms_build.tpl.php,v 1.55.2.2 2014-12-21 15:40:18 Alexandre Exp $
if (stristr($_SERVER['REQUEST_URI'], "tpl.php")) {
    die("no access");
}
if ($cms_url_base_cms_build) {
    $build_url = $cms_url_base_cms_build;
} else {
    $build_url = $pmb_opac_url;
}
function cms_gen_objet_css($name)
{
    $objet_css = "\n\t<input dojoType='dijit.form.NumberSpinner' value='' smallDelta='1' constraints='{min:-2000,max:2000,places:0}' id='{$name}' name='{$name}' style= 'width:80px'\n\t\tintermediateChanges='true'\n\t \tonchange =\"cms_change_css(document.getElementById('cms_edit_form').getAttribute('cms_edit_id'));\"\n\t/>\n\t<select id='" . $name . "_def' name='" . $name . "_def' onchange =\"cms_change_css_format_number(this,'{$name}');cms_change_css(document.getElementById('cms_edit_form').getAttribute('cms_edit_id'));\">\n\t\t<option value='auto'>auto</option>\n\t\t<option value='px'>px</option>\n\t\t<option value='%'>%</option>\n\t\t<option value='inherit'>inherit</option>\n\t</select>\n\t";
    return $objet_css;
}
$cms_edit_css = "\n\t<script type='text/javascript'>\n\n\t\tfunction cms_change_css_format_number(obj,id_number){\n\t\t\tobj_number=document.getElementById(id_number);\n\t\t\tobj_number_field=document.getElementById('widget_'+id_number);\n\t\t\tswitch(obj.options[obj.selectedIndex].value){\n\t\t\t\tcase 'auto':\n\t\t\t\t\tobj_number_field.style.display='none';\n\t\t\t\tbreak;\n\t\t\t\tcase 'px':\n\t\t\t\t\tobj_number_field.style.display='block';\n\t\t\t\tbreak;\n\t\t\t\tcase '%':\n\t\t\t\t\tobj_number_field.style.display='block';\n\t\t\t\tbreak;\n\t\t\t\tcase 'inherit':\n\t\t\t\t\tobj_number_field.style.display='none';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t    dojo.require('dijit.form.NumberSpinner');\n\n\t    function cms_add_div_change(id){\n\t   \t\tvar obj =parent.frames['opac_frame'].document.getElementById(id);\n\t    \tvar div_name='add_div_'+id;\n\t    \tvar obj_div=parent.frames['opac_frame'].document.getElementById(div_name);\n\t\t\tif(document.getElementById('div_class_row').checked) {\n\t\t\t\tif(obj_div) return;// il existe dégà\n\t\t\t\tvar obj_div = parent.frames['opac_frame'].document.createElement('div');\n\t\t\t\tobj_div.setAttribute('id',div_name);\n\t\t\t\tobj_div.className='row';\n\t\t\t\tobj.parentNode.insertBefore(obj_div,obj);\n\n\t\t\t}else{\n\t\t\t\t//on enlève le div\n\t\t\t\tif(obj_div){\n\t\t\t\t\tobj_div=obj_div.parentNode.removeChild(obj_div);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar msg_cms_reset_css='" . addslashes($msg['cms_edit_form_reset_css_bt']) . "';\n\t\tfunction cms_reset_css(id){\n\t\t\tif(confirm('" . $msg["cms_edit_form_reset_css_bt_confirm"] . "')){\n\t\t\t\tif(parent.frames['opac_frame'].document.getElementById(id)) {\n\t\t\t\t\tparent.frames['opac_frame'].document.getElementById(id).setAttribute('style','');\n\t\t\t\t\tsetTimeout(function() { cms_show_obj(id) },1000);\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t</script>\n\n\t<div id='cms_edit_form' cms_edit_id='' >\n\t\t<h3>\n\t\t\t" . $msg["cms_edit_css"] . "\n\t\t</h3>\n\t\t<div class='row'>\n\t\t\t<span id='cms_edit_title_obj'>\n\t\t</span></div>\n\t\t<div class='row'>\n\t\t\t<span id='cms_edit_form_reset_css_obj'>\n\t\t</span></div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_position"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<select id='cms_position' name='cms_position' onchange =\"cms_change_css(document.getElementById('cms_edit_form').getAttribute('cms_edit_id'));\">\n\t\t\t\t<option value='absolute'>absolute</option>\n\t\t\t\t<option value='fixed'>fixed</option>\n\t\t\t\t<option value='relative'>relative</option>\n\t\t\t\t<option value='static'>static</option>\n\t\t\t</select>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_left"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_left") . "\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_top"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_top") . "\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_zindex"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<input dojoType='dijit.form.NumberSpinner' value='' smallDelta='10' constraints=\"{min:9,max:1550,places:0}\"\n\t\t \t\tid='cms_zIndex' jsId='cms_zIndex' name='cms_zIndex'\n\t\t \t\tstyle= 'width:80px'\n\t\t\t \tonchange =\"cms_change_css(document.getElementById('cms_edit_form').getAttribute('cms_edit_id'));\"\n\t\t\t/>\n\n\t\t</div>\n\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_visibility"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<select id='cms_visibility' name='cms_visibility' onchange =\"cms_change_css(document.getElementById('cms_edit_form').getAttribute('cms_edit_id'));\">\n\t\t\t\t<option value='hidden'>hidden</option>\n\t\t\t\t<option value='visible'>visible</option>\n\t\t\t</select>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_height"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_height") . "\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_width"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_width") . "\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_float"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<select id='cms_float' name='cms_float' onchange =\"cms_change_css(document.getElementById('cms_edit_form').getAttribute('cms_edit_id'));\">\n\t\t\t\t<option value='left'>left</option>\n\t\t\t\t<option value='right'>right</option>\n\t\t\t\t<option value='none'>none</option>\n\t\t\t\t<option value='inherit'>inherit</option>\n\t\t\t</select>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_margin_top"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_margin_top") . "\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_padding_top"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_padding_top") . "\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_margin_right"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_margin_right") . "\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_padding_right"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_padding_right") . "\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_margin_bottom"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_margin_bottom") . "\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_padding_bottom"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_padding_bottom") . "\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_margin_left"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_margin_left") . "\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_padding_left"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t" . cms_gen_objet_css("cms_padding_left") . "\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>" . $msg["cms_edit_form_display"] . "&nbsp;</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<select id='cms_display' name='cms_display' onchange =\"cms_change_css(document.getElementById('cms_edit_form').getAttribute('cms_edit_id'));\">\n\t\t\t\t<option value='block'>block</option>\n\t\t\t\t<option value='none'>none</option>\n\t\t\t\t<option value='inline'>inline</option>\n\t\t\t\t<option value='inline-block'>inline-block</option>\n\t\t\t\t<option value='inline-table'>inline-table</option>\n\t\t\t\t<option value='list-item'>list-item</option>\n\t\t\t\t<option value='run-in'>run-in</option>\n\t\t\t\t<option value='table'>table</option>\n\t\t\t\t<option value='table-caption'>table-caption</option>\n\t\t\t\t<option value='table-column-group'>table-column-group</option>\n\t\t\t\t<option value='table-header-group'>table-header-group</option>\n\t\t\t\t<option value='table-footer-group'>table-footer-group</option>\n\t\t\t\t<option value='table-row-group'>table-row-group</option>\n\t\t\t\t<option value='table-cell'>table-cell</option>\n\t\t\t\t<option value='table-column'>table-column</option>\n\t\t\t\t<option value='table-row'>table-row</option>\n\t\t\t\t<option value='inherit'>inherit</option>\n\t\t\t</select>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<input type='checkbox' id='div_class_row' name='div_class_row' onclick=\"cms_add_div_change(document.getElementById('cms_edit_form').getAttribute('cms_edit_id'));\" value='1' >\n\t\t\t" . $msg["cms_edit_form_div_class_row"] . "\n\t\t</div>\n\t</div>\n";
$cms_objet_type_selection = "\n\t<h3>\n\t\t" . $msg["cms_edit_objet_selection"] . "\n\t</h3>\n\t<div class='row'>\n\n\t\t<table border='0'  width='100%' cellspacing='0'>\n\t\t<tr>\n\t\t\t<td>" . $msg["cms_dragable_type"] . "\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input  type='radio' id='cms_dragable_cadre' name='cms_dragable_type' value='zone' onclick=\"cms_drag_activate_form();\" ><label for='cms_dragable_cadre'>" . $msg["cms_dragable_zone"] . "</label>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input  type='radio' id='cms_dragable_object' name='cms_dragable_type' value='cadre'  checked='checked' onclick=\"cms_drag_activate_form();\" ><label for='cms_dragable_object'>" . $msg["cms_dragable_cadre"] . "</label>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t" . $msg["cms_receptable_type"] . "\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input  type='radio' id='cms_receptable_conteneur' name='cms_receptable_type' value='conteneur' onclick=\"cms_drag_activate_form();\" ><label for='cms_receptable_conteneur'>" . $msg["cms_receptable_conteneur"] . "</label>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input  type='radio' id='cms_receptable_cadre' name='cms_receptable_type'  value='zone' checked='checked' onclick=\"cms_drag_activate_form();\" ><label for='cms_receptable_cadre'>" . $msg["cms_receptable_zone"] . "</label>\n\t\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t</div>\n\t<div class='row'>\n\t\t<input type='button'  class='bouton'  id='cms_drag_activate_button' active='' value='" . $msg["cms_activer_drag_drop"] . "'  onclick=\"cms_drag_activate_form(); return false;\">\n\t\t<input type='button' class='bouton' value='" . $msg["cms_build_reload"] . "' onclick=\"cms_reload_opac(); return false;\">\n\t</div>\n\t";
$cms_edit_objet = "\n\t<script type='text/javascript'>\n\n\t\tfunction cms_opac_loaded(url){\n\t\t\tdocument.getElementById('cms_drag_activate_button').setAttribute('active','0')\n\t\t\tcms_drag_activate_form();\n\t\t\tcms_refresh_cadres_list();\n\n\t\t\tvar frame=document.getElementById('opac_frame');\n\t\t\tdocument.getElementById('cms_navig_information').innerHTML=url;\n\t\t}\n\t\tfunction cms_drag_activate_form(){\n\t\t\tif(document.getElementById('cms_drag_activate_button').getAttribute('active') ){\n\t\t\t\tcms_drag_activate(0,0,0);\n\t\t\t\tdocument.getElementById('cms_drag_activate_button').style.backgroundColor ='';\n\t\t\t\tdocument.getElementById('cms_drag_activate_button').setAttribute('active','')\n\t\t\t\tdocument.getElementById('cms_drag_activate_button').value='" . $msg["cms_activer_drag_drop"] . "';\n\t\t\t\treturn;\n\t\t\t} else{\n\t\t\t\tdocument.getElementById('cms_drag_activate_button').style.backgroundColor ='#00FF00';\n\t\t\t\tdocument.getElementById('cms_drag_activate_button').setAttribute('active','1')\n\t\t\t\tdocument.getElementById('cms_drag_activate_button').value='" . $msg["cms_reset_drag_drop"] . "';\n\t\t\t}\n\n\t\t\tvar radioButtons=document.getElementsByName('cms_dragable_type');\n\t\t\tvar cms_dragable_type=0;\n\t\t\tfor (var i=0; i < radioButtons.length; i ++) {\n\t            if (radioButtons[i].checked) {\n                    cms_dragable_type=radioButtons[i].value;\n                }\n\t        }\n\n\t\t\tvar radioButtons=document.getElementsByName('cms_receptable_type');\n\t\t\tvar cms_receptable_type=0;\n\t\t\tfor (var i=0; i < radioButtons.length; i ++) {\n\t            if (radioButtons[i].checked) {\n                    cms_receptable_type=radioButtons[i].value;\n                }\n\t        }\n\n\t\t\tcms_drag_activate(1,cms_dragable_type,cms_receptable_type);\n\t\t}\n\t</script>\n\n\n\n";
$cms_build_cadres_in_page_tpl = "\n\t<script type='text/javascript'>\n\n\t\tvar cms_cadre_portail_list=new Array();\n\t\t!!cms_cadre_portail_list!!\n\t</script>\n\t<table id='cms_portail_cadres_list'>\n\t\t!!items!!\n\t</table>\n";
$cms_build_cadres_not_in_page_tpl = "\n\t<table id='cms_portail_cadres_not_in_page_list'>\n\t\t!!items!!\n\t</table>\n";
$cms_build_cadre_tpl_item = "\n<tr class='!!odd_even!!' style='cursor: pointer;' onmouseout=\"this.className='!!odd_even!!'\" onmouseover=\"this.className='surbrillance'\"\n \tonclick=\"cms_show_obj('!!cadre_object!!_!!id_cadre!!');return false; \" >\n\t<td>\n\t\t<a onclick=\"cms_build_load_module('!!cadre_object!!','get_form',!!id_cadre!!);\" href='#' >\n\t\t\t<img class='icon' width='16' height='16' title='" . $msg["cms_build_edit_bt"] . "' alt='" . $msg["cms_build_page_add_bt"] . "' src='./images/b_edit.png'  >\n\t\t</a>\n\t\t!!cadre_name!!\n\t\t<div data-dojo-type='dijit/form/DropDownButton' style='float:right;'>\n\t\t    <span></span>\n\t\t    <!-- The dialog portion -->\n\t\t    <div data-dojo-type='dijit/TooltipDialog' id='ttDialog_!!id_cadre!!'>\n\t\t    \t<label class='etiquette' for='cadre_classement_list'>" . $msg['cms_build_cadre_classement_list'] . "</label>\n\t\t   \t\t<br />\n\t\t\t\t<select data-dojo-type='dijit/form/ComboBox' id='classement_!!id_cadre!!' name='classement_!!id_cadre!!'>\n\t\t\t\t    !!classement_list!!\n\t\t\t\t</select>\n\t\t        <br />\n\t\t \t\t<button data-dojo-type='dijit/form/Button'  onclick=\"cms_save_cadre_classement(!!id_cadre!!);return false; \"  type='submit'>" . $msg["cms_build_cadre_classement_save"] . "</button>\n\t\t    </div>\n\t\t</div>\n\t</td>\n</tr>\n";
$cms_build_cadre_tpl_not_in_page_item = "\n<tr class='!!odd_even!!' style='cursor: pointer;' onmouseout=\"this.className='!!odd_even!!'\" onmouseover=\"this.className='surbrillance'\" >\n\t<td>\n\t\t<a onclick=\"!!load_page_opac!!cms_build_load_module('!!cadre_object!!','get_form',!!id_cadre!!);\" href='#' >\n\t\t\t<img class='icon' width='16' height='16' title='" . $msg["cms_build_edit_bt"] . "' alt='" . $msg["cms_build_page_add_bt"] . "' src='./images/b_edit.png'  >\n\t\t</a>\n\t\t!!cadre_link!!\n\t\t<div data-dojo-type='dijit/form/DropDownButton' style='float:right'>\n\t\t    <span></span>\n\t\t    <!-- The dialog portion -->\n\t\t    <div data-dojo-type='dijit/TooltipDialog' id='ttDialog_!!id_cadre!!'>\n\t\t    \t<label class='etiquette' for='cadre_classement_list'>" . $msg['cms_build_cadre_classement_list'] . "</label>\n\t\t   \t\t<br />\n\t\t\t\t<select data-dojo-type='dijit/form/ComboBox' id='classement_!!id_cadre!!' name='classement_!!id_cadre!!'>\n\t\t\t\t    !!classement_list!!\n\t\t\t\t</select>\n\t\t        <br />\n\t\t \t\t<button data-dojo-type='dijit/form/Button'  onclick=\"cms_save_cadre_classement(!!id_cadre!!);return false; \"  type='submit'>" . $msg["cms_build_cadre_classement_save"] . "</button>\n\t\t    </div>\n\t\t</div>\n\t</td>\n</tr>\n";
$cms_build_pages_tpl = "\n<script type='text/javascript'>\n    dojo.require('dijit.form.Button');\n    dojo.require('dijit.Dialog');\n    dojo.require('dojo.parser');\n    dojo.require('dojox.layout.ContentPane');\n    dojo.require('dojox.widget.Dialog');\n    dojo.require('dojox.widget.DialogSimple');\n\n    function cms_build_page_edit_add(id){\n     \tif(!dijit.byId('cms_build_dialog')){\n\t        //creates a new dialog\n\t        try {\n\t        \tvar myDijit = new dojox.widget.DialogSimple({title: 'Referent',executeScripts:true, id:'cms_build_dialog'});\n\t\t\t}catch(e){\n\t\t\t\tif(typeof console != 'undefined') {console.log(e);}\n\t\t\t};\n\t\t}\n        //get the dialog\n        var dialogDijit = dijit.byId('cms_build_dialog');\n        dialogDijit.set('title','" . $msg["cms_menu_pages"] . "');\n        var path = './ajax.php?module=cms&categ=pages&sub=edit&id='+id\n        dialogDijit.attr('href', path);\n     \tdialogDijit.startup();\n        dialogDijit.show();\n\t}\n\n\tfunction cms_build_page_add(page){\n\t\tvar frame=document.getElementById('opac_frame')\n\t\tvar url='" . $build_url . "index.php?cms_build_activate=1&lvl=cmspage&pageid='+page;\n\t\tframe.setAttribute('src', url);\n\t}\n\n\t</script>\n\t<div id='cms_build_pages_list'>\n\t\t<table>\n\t\t\t!!items!!\n\t\t</table>\n\t</div>\n\t<input type='button' class='bouton' value='" . $msg["cms_build_page_add_bt"] . "' onclick=\"cms_build_page_edit_add('0'); return false;\">\n";
$cms_build_pages_tpl_item = "\n<a href='#' onclick=\"cms_build_page_edit_add('!!id!!');\"><img class='icon' width='16' height='16' title='" . $msg["cms_build_edit_bt"] . "' alt='" . $msg["cms_build_page_add_bt"] . "' src='./images/b_edit.png'> </a>\n<a href='#' onclick=\"cms_build_page_add('!!id!!');\">!!name!!</a>\n<br/>\n";
$cms_build_pages_tpl_item_old = "\n<tr class='!!odd_even!!' style='cursor: pointer;' onmouseout=\"this.className='!!odd_even!!'\" onmouseover=\"this.className='surbrillance'\" >\n\t<td>\n\t\t<a href='#' onclick=\"cms_build_page_edit_add('!!id!!');\"><img class='icon' width='16' height='16' title='" . $msg["cms_build_edit_bt"] . "' alt='" . $msg["cms_build_page_add_bt"] . "' src='./images/b_edit.png'> </a>\n\t\t<a href='#' onclick=\"cms_build_page_add('!!id!!');\">!!name!!</a>\n\t\t<div data-dojo-type='dijit/form/DropDownButton' style='float:right;'>\n\t\t    <span></span>\n\t\t    <!-- The dialog portion -->\n\t\t    <div data-dojo-type='dijit/TooltipDialog' id='ttDialog_page_!!id!!'>\n\t\t    \t<label class='etiquette' for='cadre_classement_list'>" . $msg['cms_build_page_classement_list'] . "</label>\n\t\t   \t\t<br />\n\t\t\t\t<select data-dojo-type='dijit/form/ComboBox' id='classement_page!!id!!' name='classement_page!!id!!'>\n\t\t\t\t    !!classement_page_list!!\n\t\t\t\t</select>\n\t\t        <br />\n\t\t \t\t<button data-dojo-type='dijit/form/Button'  onclick=\"cms_save_page_classement(!!id!!);return false; \"  type='submit'>" . $msg["cms_build_page_classement_save"] . "</button>\n\t\t    </div>\n\t\t</div>\n\t</td>\n</tr>\n";
$cms_build_pages_ajax_tpl = "\n\t<table>\n\t\t!!items!!\n\t</table>\n";
$cms_build_modules_tpl = "\n  <script type='text/javascript'>\n        function cms_build_load_module(module,action,id){\n            if(!module.match('cms_module_')){\n                 module = 'cms_module_'+module;\n            }\n\t    \tif(!dijit.byId('cms_build_dialog')){\n\t\t        //creates a new dialog\n\t\t        var myDijit = new dojox.widget.DialogSimple({\n\t\t        \ttitle: '" . $msg["cms_build_modules"] . "',\n\t\t        \texecuteScripts:true,\n\t\t        \tid:'cms_build_dialog'\n\t\t        });\n\t\t\t}\n\t\t\tvar dialogDijit = dijit.byId('cms_build_dialog');\n\t\t\tdialogDijit.set('title','" . $msg["cms_build_modules"] . "');\n\n\t\t\t//définition du post !\n\t        var post_datas = '&callback=window.parent.cms_build_save_module';\n\t        post_datas+='&cancel_callback=window.parent.cms_build_cancel_module';\n\t        post_datas+='&delete_callback=window.parent.cms_build_delete_callback';\n\t      \tpost_datas+='&cms_build_info=' + parent.frames['opac_frame'].document.getElementById('cms_build_info').value;\n\n\t\t\tvar xhrAgrs = {\n\t\t\t\turl : './ajax.php?module=cms&categ=module&elem='+module+'&action='+action+'&id='+id,\n\t\t\t\tpostData : post_datas,\n\t\t\t\thandelAs : 'text/html',\n\t\t\t\tload : function(data){\n\t\t\t\t\tdialogDijit.set('content',data);\n     \t\t\t\tdialogDijit.startup();\n  \t\t\t\t\tdialogDijit.show();\n\t\t\t\t}\n\t\t\t}\n\t\t\tdojo.xhrPost(xhrAgrs);\n        }\n\n        function cms_build_cancel_module(data){\n        \tdijit.byId('cms_build_dialog').hide();\n        }\n\n         function cms_build_delete_callback(data){\n        \tdijit.byId('cms_build_dialog').hide();\n\n        \tcms_refresh_cadres_list();\n\t\t\t// delete du cadre dans l'opac si présent\n\t\t\tvar cadre=parent.frames['opac_frame'].document.getElementById(data.dom_id);\n\t\t\tif(cadre){\n\t\t\t\tcadre.parentNode.removeChild(cadre);\n\t\t\t}\n       \t}\n\n        function cms_build_save_module(data){\n        \tdijit.byId('cms_build_dialog').hide();\n        \tvar content = '<h2>'+data.name+'</h2><p>" . $msg['cms_module_refresh_frame'] . "</p>';\n\t\t\tcms_build_new_cadre(data.dom_id,content);\n\t\t\tcms_refresh_cadres_list();\n\n\t\t\tcms_drag_activate_form();\n        }\n\t</script>\n\t!!items!!\n";
$cms_build_versions_tpl = "\n\n\t<script type='text/javascript'>\n\t    dojo.require('dijit.form.Button');\n\t    dojo.require('dijit.Dialog');\n\t    dojo.require('dojo.parser');\n\t    dojo.require('dojox.layout.ContentPane');\n\t    dojo.require('dojox.widget.Dialog');\n\t    dojo.require('dojox.widget.DialogSimple');\n\n\t    function cms_build_version_edit_add(id){\n\t    \tif(!dijit.byId('cms_build_dialog')){\n\t\t        //creates a new dialog\n\t\t        try {\n\t\t        \tvar myDijit = new dojox.widget.DialogSimple({title: 'Referent',executeScripts:true, id:'cms_build_dialog'});\n\t\t\t\t}catch(e){\n\t\t\t\t\tif(typeof console != 'undefined') {console.log(e);}\n\t\t\t\t};\n\t\t\t}\n\t        //get the dialog\n\t        var dialogDijit = dijit.byId('cms_build_dialog');\n\t        dialogDijit.set('title','" . $msg["cms_build_versions"] . "');\n\n\t        var path = './ajax.php?module=cms&categ=versions&sub=edit&id='+id\n\t        dialogDijit.attr('href', path);\n\n\t     \tdialogDijit.startup();\n\t        dialogDijit.show();\n\t\t}\n\n\t\tfunction cms_build_version_select(page){\n\t\t\tvar frame=document.getElementById('opac_frame')\n\t\t\tframe.setAttribute('src', '" . $build_url . "index.php?cms_build_activate=1&lvl=cmspage&pageid='+page);\n\t\t}\n\t</script>\n\t<div id='cms_build_versions_list'>\n\t\t!!items!!\n\t</div>\n\t<input type='button' class='bouton' value='" . $msg["cms_build_version_add_bt"] . "' onclick=\"cms_build_version_edit_add('0'); return false;\">\n";
$cms_build_versions_tpl_item = "\n<a href='#' onclick=\"cms_build_version_edit_add('!!id!!');\"><img class='icon' width='16' height='16' title='" . $msg["cms_build_version_edit_bt"] . "' alt='" . $msg["cms_build_version_edit_bt"] . "' src='./images/b_edit.png'> </a>\n!!name!! !!opac_default!! !!cms_in_use!!<br/>\n";
$cms_build_versions_ajax_tpl = "\n\t!!items!!\n";
$cms_build_version_form_ajax_tpl = "\n\t<script type='text/javascript'>\n\t\tfunction confirm_delete_cms(id){\n\n\t\t\tvar sup = confirm('" . $msg['cms_version_confirm_suppr'] . "');\n\t\t\tif(!sup) return false;\n\n\t\t\tvar post_data='';\n\t\t\t// Envoi du tout au serveur\n\t\t\tvar http=new http_request();\n\t\t\tvar url = './ajax.php?module=cms&categ=versions&sub=del_cms&id='+id;\n\t\t\thttp.request(url,true,post_data);\n\t\t\tdocument.getElementById('cms_build_versions_list').innerHTML= http.get_text();\n\t\t\tdijit.byId('cms_build_dialog').hide();\n\t\t}\n\n\t\tfunction test_form(form) {\n\t\t\tif(!form.name.value){\n\t\t    \talert('" . $msg["cms_version_no_name"] . "');\n\t\t\t\treturn false;\n\t\t    }\n\t    }\n\n\t    function cms_version_ajax_save(id){\n\t\t\tvar post_data='';\n\t\t\t// Envoi du tout au serveur\n\t\t\tvar http=new http_request();\n\t\t\tvar url = './ajax.php?module=cms&categ=versions&sub=save&id='+id;\n\t\t\tpost_data='name=' + document.getElementById('name').value;\n\t\t\tpost_data+='&comment=' + document.getElementById('comment').value;\n\t\t\tvar opac_default='';\n\t\t\tif(document.getElementById('opac_default').checked) opac_default=1;\n\t\t\tpost_data+='&opac_default=' + opac_default;\n\t\t\thttp.request(url,true,post_data);\n\t\t\treturn http.get_text();\n\n\t    }\n\n\t    function confirm_delete_version(id){\n\t\t\t// Contexte de la page Opac: cms_build_info\n\t\t\tvar post_data='';\n\t\t\t// Envoi du tout au serveur\n\t\t\tvar http=new http_request();\n\t\t\tvar url = './ajax.php?module=cms&categ=versions&sub=del_version&id='+id;\n\t\t\thttp.request(url);\n\t\t\tdocument.getElementById('tr_version_'+id).parentNode.removeChild(document.getElementById('tr_version_'+id));\n\t\t\treturn true;\n\t\t}\n\t</script>\n\n\t\t<h3>!!form_title!!</h3>\n\t\t<div class='form-contenu'>\n\t\t\t<div class='row'>\n\t\t\t\t<label class='etiquette' for='name'>" . $msg['cms_version_form_title'] . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<input type=text id='name' name='name' value=\"!!name!!\" class='saisie-50em' />\n\t\t\t</div>\n\n\t\t\t<div class='row'>\n\t\t\t\t<label class='etiquette' for='comment'>" . $msg['cms_version_form_comment'] . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<textarea id='comment' name='comment' cols='120' rows='5'>!!comment!!</textarea>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<label class='etiquette' for='opac_default'>" . $msg['cms_build_cms_opac_default'] . "</label>\n\t\t\t\t<input type='checkbox' id='opac_default' !!opac_default_checked!! value='1' name='opac_default'>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<label class='etiquette' for='version_tag'>" . $msg['cms_version_form_version_tag'] . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\n\t\t\t\t<h3>" . $msg["cms_build_versions"] . "</h3>\n\t\t\t\t<table class='cms_build_versions_list'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>" . $msg['cms_build_versions_date'] . "</th>\n\n\t\t\t\t\t\t<th></th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t!!version_list!!\n\t\t\t\t</table>\n\n\t\t\t</div>\n\n\n\t\t\t<div class='row'>&nbsp;</div>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<div class='left'>\n\t\t\t\t<input type='submit'  class='bouton' value='" . $msg['cms_page_form_save'] . "'\n\t\t\t\tonClick=\"\n\t\t\t\t\tdocument.getElementById('cms_build_versions_list').innerHTML=cms_version_ajax_save(!!id!!);\n\t\t\t\t\tdijit.byId('cms_build_dialog').hide();\n\t\t\t\t \" />\n\t\t\t </div>\n\t\t\t<div class='right'>\n\t\t\t\t!!form_suppr!!\n\t\t\t</div>\n\t\t</div>\n\t\t<div class='row'></div>\n";