Example #1
0
function getBlock_Select_templates($id = '')
{
    $res = get_templates();
    $options = '';
    while ($row = mysql_fetch_array($res, MYSQL_BOTH)) {
        $options .= '<option ' . ($row['template_id'] == $id ? ' selected ' : '') . '>' . $row['title'] . '</option>';
    }
    return '<select name="templates">' . $options . '</select>';
}
function print_template_selectboxes()
{
    global $site;
    global $objekt;
    // TODO: get rid of global objekt
    // content templates
    $ttyyp = "";
    # init ttyyp
    $selected_value = $objekt->all['ttyyp_id'];
    print "\r\n\t<tr>\r\n\t  <td nowrap>" . $site->sys_sona(array(sona => "Content template", tyyp => "editor")) . ":</td>\r\n      <td width='100%'>\r\n\t  <select name=ttyyp_id class='scms_flex_input' style='max-width: 334px' onChange=\"document.frmEdit.refresh.value='1';document.frmEdit.submit();\">\r\n\t    <option value=\"\"></option>\r\n\t";
    $content_templates = get_templates('CONTENT', $selected_value);
    if ($content_templates['template_variable_html']) {
        $template_variable_html = $content_templates['template_variable_html'];
        unset($content_templates['template_variable_html']);
    }
    foreach ($content_templates as $group => $templates) {
        print '<optgroup label="' . $group . '">';
        foreach ($templates as $templ) {
            if ($selected_value == $templ['ttyyp_id']) {
                $ttyyp = $templ;
            }
            print "<option value=\"" . $templ['ttyyp_id'] . "\"" . ($selected_value == $templ['ttyyp_id'] ? " selected" : "") . ($templ['ttyyp_id'] == $objekt->all['ttyyp_id'] || $templ['ttyyp_id'] == $objekt->all['page_ttyyp_id'] ? " style=\"color: #a7a6aa;\"" : "") . ">";
            print $templ['nimi'];
            print "</option>\n";
        }
        print '</optgroup>';
    }
    print "\r\n\t  </select>\r\n\t  </td>\r\n    </tr>";
    // page templates
    $page_ttyyp = "";
    # init ttyyp
    $selected_value = $objekt->all['page_ttyyp_id'];
    print "\r\n\t<tr>\r\n\t  <td nowrap>" . $site->sys_sona(array(sona => "Page template", tyyp => "editor")) . ":</td>\r\n      <td width='100%'>";
    print "<select name=page_ttyyp_id class='scms_flex_input' style='max-width: 334px'>\r\n\t\t<option value=\"\"></option>\r\n\t";
    $page_templates = get_templates('PAGE', $selected_value);
    foreach ($page_templates as $group => $templates) {
        print '<optgroup label="' . $group . '">';
        foreach ($templates as $templ) {
            if ($selected_value == $templ['ttyyp_id']) {
                $page_ttyyp = $templ;
            }
            // TODO: find out why this is here and possibly get rid of it
            print "<option value=\"" . $templ['ttyyp_id'] . "\"" . ($selected_value == $templ['ttyyp_id'] ? " selected" : "") . ($templ['ttyyp_id'] == $objekt->all['ttyyp_id'] || $templ['ttyyp_id'] == $objekt->all['page_ttyyp_id'] ? " style=\"color: #a7a6aa;\"" : "") . ">";
            print $templ['nimi'];
            print "</option>\n";
        }
        print '</optgroup>';
    }
    print "\r\n\t  </select>\r\n\t  </td>\r\n    </tr>";
    ############################
    # CONTENT TEMPLATE configuration
    if ($ttyyp['on_konfigureeritav']) {
        echo $template_variable_html;
    }
    # / template configuration
    ############################
    return $ttyyp;
}
Example #3
0
        $error_template = "Помилка збереження: " . mysql_error();
    }
}
if ($_POST['remove_template']) {
    remote_template($_POST['template_id']);
    $error_template = mysql_error();
}
?>

<div class="table">
    <p class="error"><?php 
echo $error_template;
?>
</p>
    <?php 
$res = get_templates();
?>
    <?php 
while ($row = mysql_fetch_array($res, MYSQL_BOTH)) {
    ?>
        <div class="row">
            <form method="post" enctype="multipart/form-data">
                <input type="hidden" name="template_id" value="<?php 
    echo $row['template_id'];
    ?>
">
            <div class="col">

                <div class="col2">
                    <div>
                        <label for="title">Титульна назва:</label>
Example #4
0
}
switch ($r->getName()) {
    case 'abort_batch':
        handle_abort_batch($r);
        break;
    case 'abort_jobs':
        handle_abort_jobs($r);
        break;
    case 'create_batch':
        create_batch($r);
        break;
    case 'estimate_batch':
        estimate_batch($r);
        break;
    case 'get_templates':
        get_templates($r);
        break;
    case 'ping':
        ping($r);
        break;
    case 'query_batch':
        query_batch($r);
        break;
    case 'query_batch2':
        query_batch2($r);
        break;
    case 'query_batches':
        query_batches($r);
        break;
    case 'query_job':
        query_job($r);
/**
 * This source file is is part of Saurus CMS content management software.
 * It is licensed under MPL 1.1 (http://www.opensource.org/licenses/mozilla1.1.php).
 * Copyright (C) 2000-2010 Saurused Ltd (http://www.saurus.info/).
 * Redistribution of this file must retain the above copyright notice.
 * 
 * Please note that the original authors never thought this would turn out
 * such a great piece of software when the work started using Perl in year 2000.
 * Due to organic growth, you may find parts of the software being
 * a bit (well maybe more than a bit) old fashioned and here's where you can help.
 * Good luck and keep your open source minds open!
 * 
 * @package		SaurusCMS
 * @copyright	2000-2010 Saurused Ltd (http://www.saurus.info/)
 * @license		Mozilla Public License 1.1 (http://www.opensource.org/licenses/mozilla1.1.php)
 * 
 */
function edit_objekt()
{
    global $site;
    global $objekt;
    global $keel;
    global $class_path;
    global $tyyp;
    // refreshing (fdat['refresh'] = 1) looses object data, I don't know why and because it's done in edit_object.php, I'm not going to fix it, lord knows what it'll screw up
    if ($site->fdat['refresh'] && $site->fdat['id']) {
        $obj = new Objekt(array('objekt_id' => $site->fdat['id']));
        $objekt->objekt_id = $obj->objekt_id;
        $objekt->parent_id = $obj->parent_id;
    }
    if ($objekt->parent_id || $site->fdat['op'] == 'new') {
        $parent = new Objekt(array('objekt_id' => $objekt->objekt_id ? $objekt->parent_id : $site->fdat['parent_id']));
        $pearubriik = $parent->all['sys_alias'] == 'home' ? 1 : 0;
    } else {
        $pearubriik = 0;
    }
    $content_templates = get_templates('CONTENT', $objekt->all['ttyyp_id']);
    if ($content_templates['template_variable_html']) {
        $template_variable_html = $content_templates['template_variable_html'];
        unset($content_templates['template_variable_html']);
    }
    $page_templates = get_templates('PAGE', $objekt->all['page_ttyyp_id']);
    $sql = $site->db->prepare('select ttyyp_id, page_ttyyp_id from keel where keel_id = ' . $keel);
    $default_templates = new SQL($sql);
    $default_templates = $default_templates->fetch('ASSOC');
    foreach ($page_templates as $name => $group) {
        if ($group[$default_templates['page_ttyyp_id']]) {
            $default_page_template = array('id' => $default_templates['page_ttyyp_id'], 'group' => $name, 'name' => $group[$default_templates['page_ttyyp_id']]['nimi']);
        }
    }
    foreach ($content_templates as $name => $group) {
        if ($group[$default_templates['ttyyp_id']]) {
            $default_content_template = array('id' => $default_templates['ttyyp_id'], 'group' => $name, 'name' => $group[$default_templates['ttyyp_id']]['nimi']);
        }
    }
    // parent path
    if ($objekt->all['sys_alias'] == '' && $site->fdat['sys_alias'] == '') {
        // this needs serious rethink and optmisation: there's no need to get the entire tree, parent object's path to top is only needed
        include_once $class_path . 'rubloetelu.class.php';
        $rubs = new RubLoetelu(array('keel' => $keel, 'required_perm' => 'C', 'ignore_perm_for_obj' => $parent ? $parent->objekt_id : 0));
        #$rubs->debug->print_msg();
        $topparents = $rubs->get_loetelu();
        if (is_array($topparents)) {
            asort($topparents);
        }
        foreach ($topparents as $k => $v) {
            if ($parent->objekt_id == $k) {
                $section_name = $v;
                break;
            }
        }
    }
    // setup for section selection
    $_SESSION['parent_selection']['callback'] = 'window.opener.updateSection';
    $_SESSION['parent_selection']['selectable'] = 1;
    $_SESSION['parent_selection']['hide_language_selection'] = '1';
    $_SESSION['parent_selection']['mem_classes'] = array('rubriik');
    //this sucks, really
    $_SESSION['parent_selection']['db_fields'] = array('select_checkbox', 'objekt_id', 'pealkiri');
    $_SESSION['parent_selection']['display_fields'] = array('select_checkbox', 'pealkiri');
    $publish_start = $objekt->all['avaldamisaeg_algus'] > 0 ? $site->db->MySQL_ee_long($objekt->all['avaldamisaeg_algus']) : '';
    /* Don't print out time which is 00:00:00 */
    if (preg_match("/(\\d?\\d[\\:\\\\.\\/\\-]\\d?\\d[\\:\\\\.\\/\\-]\\d?\\d?\\d\\d)\\s(\\d?\\d)[\\:\\\\.\\/\\-](\\d?\\d)/", $publish_start, $aa_reg)) {
        $publish_start = $aa_reg[2] == "00" && $aa_reg[3] == "00" ? $aa_reg[1] : $publish_start;
    }
    $publish_end = $objekt->all['avaldamisaeg_lopp'] > 0 ? $site->db->MySQL_ee_long($objekt->all['avaldamisaeg_lopp']) : '';
    /* Don't print out time which is 23:59 */
    if (preg_match("/(\\d?\\d[\\:\\\\.\\/\\-]\\d?\\d[\\:\\\\.\\/\\-]\\d?\\d?\\d\\d)\\s(\\d?\\d)[\\:\\\\.\\/\\-](\\d?\\d)/", $publish_end, $la_reg)) {
        $publish_end = $la_reg[2] == "23" && $la_reg[3] == "59" ? $la_reg[1] : $publish_end;
    }
    // to get the correct path to parent objects set use_alises on
    $site->CONF['use_aliases'] = 1;
    if ($parent) {
        $parent_href = $parent->get_object_href();
    } else {
        $alias = '';
        if ($site->CONF['alias_language_format']) {
            $languages = $site->cash(array('klass' => 'GET_LANGUAGES', 'kood' => 'ALL_LANGUAGE_INFO'));
            if (empty($languages)) {
                $sql = "select keel_id, extension, on_default from keel where on_kasutusel = 1";
                $result = new SQL($sql);
                while ($row = $result->fetch('ASSOC')) {
                    $languages[$row['keel_id']] = $row;
                }
                $site->cash(array('klass' => 'GET_LANGUAGES', 'kood' => 'ALL_LANGUAGE_INFO', 'sisu' => $languages));
            }
        }
        // add languge alias - alias language format 0: none, 1: always, 2: for non-default lang objs
        if ($site->CONF['alias_language_format'] == 1) {
            $alias .= $languages[$objekt->all['keel']]['extension'] . '/';
        } elseif ($site->CONF['alias_language_format'] == 2) {
            if (!$languages[$objekt->all['keel']]['on_default']) {
                $alias .= $languages[$objekt->all['keel']]['extension'] . '/';
            }
        }
        $parent_href = '/' . $alias;
    }
    if ($parent_href && $parent_href != '/' && ($site->CONF['alias_trail_format'] == 0 || $parent->all['sys_alias'] == 'home' || $parent->all['sys_alias'] == 'trash' || $parent->all['sys_alias'] == 'system' || $parent->all['sys_alias'] == 'gallup_arhiiv')) {
        $parent_href = preg_replace('#' . preg_quote('/' . ($parent->all['friendly_url'] ? $parent->all['friendly_url'] : $parent->objekt_id), '#') . '/$#', '/', $parent_href);
    }
    $parent_href = $site->CONF['hostname'] . $parent_href;
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head> 	
		<title><?php 
    echo $site->title;
    ?>
 <?php 
    echo $site->cms_version;
    ?>
</title>
		
		<meta http-equiv="Content-Type" content="text/html; charset=<?php 
    echo $encoding ? $encoding : $site->encoding;
    ?>
" />
		<meta http-equiv="Cache-Control" content="no-cache" />
		
		<link rel="stylesheet" href="<?php 
    echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
    ?>
/datepicker.css" />
		<link rel="stylesheet" href="<?php 
    echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
    ?>
/section_editor.css" />
		
		<script type="text/javascript" src="<?php 
    echo $site->CONF['wwwroot'] . $site->CONF['js_path'];
    ?>
/yld.js"></script>
		<script type="text/javascript" src="<?php 
    echo $site->CONF['wwwroot'] . $site->CONF['js_path'];
    ?>
/edit_popup.js"></script>
		<script type="text/javascript" src="<?php 
    echo $site->CONF['wwwroot'] . $site->CONF['js_path'];
    ?>
/jquery.js"></script>
		<script type="text/javascript" src="<?php 
    echo $site->CONF['wwwroot'] . $site->CONF['js_path'];
    ?>
/datepicker.js"></script>
		<script type="text/javascript" src="<?php 
    echo $site->CONF['wwwroot'];
    ?>
/common.js.php"></script>
		
		<script type="text/javascript">
			var isIE = navigator.appVersion.match(/MSIE/); // assume gecko on false
			
			window.onload = function ()
			{
				var title = document.getElementById('pealkiri');
				
				resizeWindow();
				
				var advanced_panel_state = document.getElementById('advanced_panel_state');
				if(advanced_panel_state.value == 1)
				{
					togglePanel('advanced');
				}
				
				this.focus();
				title.focus();
			}
			
			function resizeWindow()
			{
				resizeWindowTo($('#size_wrapper').width(), $('#size_wrapper').height());
			}
			
			
			function chooseSection()
			{
				explorer_window = openpopup('explorer.php?objekt_id=home&editor=1&swk_setup=parent_selection&remove_objects=<?php 
    echo $site->fdat['id'];
    ?>
&pre_selected=' + document.getElementById('rubriik').value, 'cms_explorer', '800','600');
			}
			
			function updateSection(sections)
			{
				explorer_window.close();
				var section_name = document.getElementById('section_name');
				var section_id = document.getElementById('rubriik');
				var trail_path= new Array();

					for(var j = 0; j < sections[0].trail.length; j++){
						trail_path[j] = sections[0].trail[j].pealkiri;
					}

				section_name.innerHTML = '<a href="javascript:chooseSection();">' + trail_path.join("->") + '</a>';
				section_id.value = sections[0].objekt_id;
			}

			function editAlias()
			{
				var alias_placeholder = document.getElementById('alias_placeholder');
				var alias_value = document.getElementById('alias_value');
				
				alias_placeholder.innerHTML = '<input type="text" id="alias" value="' + alias_value.value + '" onblur="saveAlias();">';
				
		    	resizeWindow();
		    	
				var alias = document.getElementById('alias');
				alias.focus();
			}
			
			function saveAlias()
			{
				var alias_placeholder = document.getElementById('alias_placeholder');
				var alias_value = document.getElementById('alias_value');
				var alias = document.getElementById('alias');
				
				if(alias_value.value != alias.value)
				{
					$.ajax({
					    url: 'ajax_response.php?rand=' + Math.random(9999),
					    data: {op: 'generate_alias', string: alias.value, language_id: '<?php 
    echo $keel;
    ?>
'},
					    type: 'POST',
					    dataType: 'json',
					    timeout: 1000,
					    error: function()
					    {
							alias_placeholder.innerHTML = '<a href="javascript:void(0);" onclick="editAlias();" id="alias_link">' + (alias_value.value.length > 30 ? alias_value.value.substring(0, 30) + '...' : alias_value.value) + '</a>';
					    },
					    success: function(response)
					    {
					    	if(response.alias)
					    	{
								alias_value.value = response.alias;
								alias_placeholder.innerHTML = '<a href="javascript:void(0);" onclick="editAlias();" id="alias_link">' + (alias_value.value.length > 30 ? alias_value.value.substring(0, 30) + '...' : alias_value.value) + '</a>';
					    	}
					    	else
					    	{
								alias_value.value = '';
								<?php 
    if ($objekt->objekt_id) {
        ?>
								alias_placeholder.innerHTML = '<a href="javascript:void(0);" onclick="editAlias();" id="alias_link">' + '<?php 
        echo $objekt->objekt_id;
        ?>
' + '</a>';
								<?php 
    } else {
        ?>
						    	alias_placeholder.innerHTML = '<input type="text" id="alias" value="" onblur="saveAlias();">';
								<?php 
    }
    ?>
					    	}
							
					    	resizeWindow();
					    }
					});
				}
				else
				{
					if(!alias.value)
					{
						alias_value.value = '';
						<?php 
    if ($objekt->objekt_id) {
        ?>
						alias_placeholder.innerHTML = '<a href="javascript:void(0);" onclick="editAlias();" id="alias_link">' + '<?php 
        echo $objekt->objekt_id;
        ?>
' + '</a>';
						<?php 
    } else {
        ?>
				    	alias_placeholder.innerHTML = '<input type="text" id="alias" value="" onblur="saveAlias();">';
						<?php 
    }
    ?>
					}
					else
					{
						alias_placeholder.innerHTML = '<a href="javascript:void(0);" onclick="editAlias();" id="alias_link">' + (alias_value.value.length > 30 ? alias_value.value.substring(0, 30) + '...' : alias_value.value) + '</a>';
					}
			    	
					resizeWindow();
				}
			}
			
			function createAlias()
			{
				var alias_value = document.getElementById('alias_value');
				var title = document.getElementById('pealkiri')
				
				if(0 || (!alias_value && title.value))
				{
					$.ajax({
					    url: 'ajax_response.php?rand=' + Math.random(9999),
					    data: {op: 'generate_alias', string: title.value, language_id: '<?php 
    echo $keel;
    ?>
'},
					    type: 'POST',
					    dataType: 'json',
					    timeout: 1000,
					    error: function()
					    {
					    },
					    success: function(response)
					    {
					    	var alias_cell = document.getElementById('alias_cell');
					    	alias_cell.className = 'alias';
					    	if(response.alias)
					    	{
						    	alias_cell.innerHTML = '<input type="hidden" name="friendly_url" id="alias_value" value="' + response.alias + '"><?php 
    echo $parent_href;
    ?>
<span id="alias_placeholder"><a href="javascript:void(0);" onclick="editAlias();" id="alias_link">' + (response.alias.length > 30 ? response.alias.substring(0, 30) + '...' : response.alias) + '</a></span>';
					    	}
					    	else
					    	{
						    	alias_cell.innerHTML = '<input type="hidden" name="friendly_url" id="alias_value" value=""><?php 
    echo $parent_href;
    ?>
<span id="alias_placeholder"><input type="text" id="alias" value="" onblur="saveAlias();"></span>';
					    	}
					    	
					    	var alias_row = document.getElementById('alias_row');
					    	alias_row.style.display = (isIE ? 'block' : 'table-row');

					    	resizeWindow();
					    }
					});			
				}
			}
			
			function saveForm(op2)
			{
				var form = document.getElementById('editForm');
				
				var title = document.getElementById('pealkiri');
				
				if(title.value.length == 0)
				{
					alert('<?php 
    echo $site->sys_sona(array('sona' => 'please_fill_in_the_title!', 'tyyp' => 'admin'));
    ?>
');
					return;
				}
				
				var alias_value = document.getElementById('alias_value');
				var alias = document.getElementById('alias');
				
				if((title.value && !alias_value) || (alias && alias_value && alias.value != alias_value.value))
				{
					$.ajax({
					    url: 'ajax_response.php?rand=' + Math.random(9999),
					    data: {op: 'generate_alias', string: title.value, language_id: '<?php 
    echo $keel;
    ?>
'},
					    type: 'POST',
					    dataType: 'json',
					    timeout: 1000,
					    error: function()
					    {
					    	var form = document.getElementById('editForm');
			 				
					    	form.op2.value = op2;
			 				form.submit();
					    },
					    success: function(response)
					    {
					    	var alias_value = document.getElementById('alias_value');
					    	
					    	if(!alias_value && response.alias)
					    	{
						    	var alias_cell = document.getElementById('alias_cell');
						    	alias_cell.innerHTML = '<input type="hidden" name="friendly_url" id="alias_value" value="' + response.alias + '"><?php 
    echo $parent_href;
    ?>
<span id="alias_placeholder"><a href="javascript:void(0);" onclick="editAlias();" id="alias_link">' + (response.alias.length > 30 ? response.alias.substring(0, 30) + '...' : response.alias) + '</a></span>';
					    	}
							
					    	var form = document.getElementById('editForm');
			 				
					    	form.op2.value = op2;
			 				form.submit();
					    }
					});
				}
				else
				{
	 				form.op2.value = op2;
	 				form.submit();
				}
			}
		</script>
	</head>
	
	<body>
		
		<? if ($site->fdat['op']=='edit') {?>
			<iframe src="checkin.php?objekt_id=<?php 
    echo $objekt->objekt_id;
    ?>
" style="width: 0; height: 0; display: none; visibility: hidden;"></iframe>
		<? } ?>
		
		<form action="edit.php" name="editForm" id="editForm" method="POST"  enctype="multipart/form-data">
		
		<input type="hidden" name="tab" value="<?php 
    echo $site->fdat['tab'];
    ?>
" />
		<input type="hidden" id="op" name="op" value="<?php 
    echo htmlspecialchars($site->fdat['op']);
    ?>
" />
		<input type="hidden" id="op2" name="op2" value="" />
		<input type="hidden" id="refresh" name="refresh" value="0" />
		
		<input type="hidden" name="tyyp_id" value="<?php 
    echo $tyyp['tyyp_id'];
    ?>
" />
		<input type="hidden" name="tyyp" value="<?php 
    echo $tyyp['klass'];
    ?>
" />
		
		<input type="hidden" name="pearubriik" value="<?php 
    echo $pearubriik;
    ?>
" />
		<input type="hidden" name="id" value="<?php 
    echo $site->fdat['id'];
    ?>
" />
		<input type="hidden" name="parent_id" value="<?php 
    echo $site->fdat['parent_id'];
    ?>
" />
		<input type="hidden" name="previous_id" value="<?php 
    echo $site->fdat['previous_id'];
    ?>
" />
		<input type="hidden" name="keel" value="<?php 
    echo $keel;
    ?>
" />
		<input type="hidden" name="on_pealkiri" value="1" />
		
        <input type="hidden" name="sorting" value="<?php 
    echo $site->fdat['sorting'];
    ?>
">

        <input type="hidden" name="extension_path" value="<?php 
    echo $site->fdat['extension_path'];
    ?>
" />
		
		<input type="hidden" name="opener_location" value="" />
		<input type="hidden" name="publish" value="<?php 
    echo $site->fdat['publish'] ? $site->fdat['publish'] : $objekt->all['on_avaldatud'];
    ?>
" />

		<input name="permanent_parent_id" type="hidden" value="<?php 
    echo $objekt->parent_id;
    ?>
" />
		<input name="sys_alias" type="hidden" value="<?php 
    echo $site->fdat['sys_alias'] ? $site->fdat['sys_alias'] : $objekt->all['sys_alias'];
    ?>
" />
		
		<input name="advanced_panel_state" id="advanced_panel_state" type="hidden" value="<?php 
    echo $site->fdat['advanced_panel_state'] ? htmlspecialchars($site->fdat['advanced_panel_state']) : 0;
    ?>
" />
		
		<div id="size_wrapper" class="section_editor">
		
		<div id="main_container">
			<?php 
    ########### Tabs  ########
    ?>
			<div id="tab_container">
				<a href="javascript:void(0);" class="selected"><?php 
    echo $site->sys_sona(array('sona' => 'tyyp_rubriik', 'tyyp' => 'System'));
    ?>
</a>
				<?php 
    if ($objekt->objekt_id) {
        ?>
					<a href="<?php 
        echo $site->self . '?tab=seo&id=' . $site->fdat['id'] . '&keel=' . $keel . '&op=' . $site->fdat['op'];
        ?>
" onclick="resizeDocumentHeightTo(430);"><?php 
        echo $site->sys_sona(array('sona' => 'meta-info', 'tyyp' => 'admin'));
        ?>
</a>
					<?php 
    } else {
        ?>
					<a href="javascript:void(0);"><?php 
        echo $site->sys_sona(array('sona' => 'meta-info', 'tyyp' => 'admin'));
        ?>
</a>
				<?php 
    }
    ?>
				<?php 
    if ($objekt->objekt_id) {
        ?>
					<a href="<?php 
        echo $site->self . '?tab=permissions&id=' . $site->fdat['id'] . '&keel=' . $keel . '&op=' . $site->fdat['op'];
        ?>
" onclick="resizeDocumentHeightTo(430);"><?php 
        echo $site->sys_sona(array('sona' => 'permissions', 'tyyp' => 'admin'));
        ?>
</a>
					<?php 
    } else {
        ?>
					<a href="javascript:void(0);"><?php 
        echo $site->sys_sona(array('sona' => 'permissions', 'tyyp' => 'admin'));
        ?>
</a>
				<?php 
    }
    ?>
			</div>
			
			<div id="content_container">
		
				<table cellpadding="0" cellspacing="0" class="form_row">
					<tr>
						<td class="label"><label><?php 
    echo $site->sys_sona(array('sona' => 'Pealkiri', 'tyyp' => 'editor'));
    ?>
:</label></td>
						<td class="input"><input type="text" class="text" name="pealkiri" id="pealkiri" value="<?php 
    echo htmlspecialchars($objekt->all['pealkiri']);
    ?>
" onblur="createAlias();" /></td>
					</tr>
					<?php 
    if (($objekt->objekt_id || isset($objekt->all['friendly_url'])) && !($objekt->all['sys_alias'] == 'trash' || $objekt->all['sys_alias'] == 'system' || $objekt->all['sys_alias'] == 'gallup_arhiiv')) {
        ?>
					<tr>
						<td class="label">&nbsp;</td>
						<td class="input"><input type="hidden" id="alias_value" name="friendly_url" name="friendly_url" value="<?php 
        echo htmlspecialchars($objekt->all['friendly_url']);
        ?>
" /><?php 
        echo $parent_href;
        ?>
<span id="alias_placeholder"><a href="javascript:void(0);" onclick="editAlias();" id="alias_link"><?php 
        echo $objekt->all['friendly_url'] ? strlen(htmlspecialchars($objekt->all['friendly_url'])) > 30 ? substr(htmlspecialchars($objekt->all['friendly_url']), 0, 30) . '...' : htmlspecialchars($objekt->all['friendly_url']) : $objekt->objekt_id;
        ?>
</a></span></td>
					</tr>
					<?php 
    } else {
        ?>
					<tr id="alias_row">
						<td class="label">&nbsp;</td>
						<td class="input" id="alias_cell"></td>
					</tr>
					<?php 
    }
    ?>
					<tr>
						<td class="label"><label><?php 
    echo $site->sys_sona(array('sona' => 'content template', 'tyyp' => 'editor'));
    ?>
:</label></td>
						<td class="input"><select class="select" id="template_select" name="ttyyp_id" onchange="refreshForm();"><option value="0"><?php 
    echo $site->sys_sona(array('sona' => 'default', 'tyyp' => 'admin'));
    ?>
 (<?php 
    echo $default_content_template['name'];
    ?>
)</option>
						<?php 
    foreach ($content_templates as $template_group_name => $templates_group) {
        ?>
							<optgroup label="<?php 
        echo $template_group_name;
        ?>
">
						<?php 
        foreach ($templates_group as $template_id => $template) {
            ?>
						<?php 
            if ($objekt->all['ttyyp_id'] == $template_id) {
                $ttyyp = $template;
            }
            ?>
								<option value="<?php 
            echo $template_id;
            ?>
"<?php 
            echo $objekt->all['ttyyp_id'] == $template_id ? ' selected="selected" style="color: #a7a6aa;"' : '';
            ?>
><?php 
            echo $template['nimi'];
            ?>
</option>
						<?php 
        }
        ?>
							</optgroup>
						<?php 
    }
    ?>
						</select></td>
					</tr>
					<?php 
    ########### publishing  ########
    ?>
					<tr>
						<td class="label"><?php 
    echo $site->sys_sona(array('sona' => 'visible_to_visitors', 'tyyp' => 'editor'));
    ?>
</td>
						<td><input type="radio" name="publish" id="object_published" value="1"<?php 
    echo $site->fdat['publish'] || $objekt->all['on_avaldatud'] ? ' checked' : '';
    ?>
> <label for="object_published"><?php 
    echo $site->sys_sona(array('sona' => 'published', 'tyyp' => 'editor'));
    ?>
</label>	<input type="radio" name="publish" id="object_unpublished" value="0"<?php 
    echo $site->fdat['publish'] == 0 && $objekt->all['on_avaldatud'] == 0 ? ' checked' : '';
    ?>
> <label for="object_unpublished"><?php 
    echo $site->sys_sona(array('sona' => 'unpublished', 'tyyp' => 'editor'));
    ?>
</label></td>
					</tr>
				</table>
				
				<br />
				
				<?php 
    ########### advanced  ########
    ?>
				<div class="panel_toggler" onclick="togglePanel('advanced');">
					<a href="javascript:void(0);"><?php 
    echo $site->sys_sona(array('sona' => 'Advanced', 'tyyp' => 'editor'));
    ?>
 <span id="advanced_panel_link_state">&raquo;</span></a>
				</div>
				
				<div id="advanced_panel" class="panel">
					
					<?php 
    ########### parent section  ########
    ?>
					<?php 
    if ($section_name) {
        ?>
					<table cellpadding="0" cellspacing="0" class="form_row">
						<tr>
							<td class="label"><label><?php 
        echo $site->sys_sona(array('sona' => 'Rubriigid', 'tyyp' => 'editor'));
        ?>
:</label></td>
							<td class="input">
								<table cellpadding="0" cellspacing="0" class="cf_container">
									<tr>
										<th><input type="hidden" name="rubriik[]" id="rubriik" value="<?php 
        echo $parent ? $parent->objekt_id : 0;
        ?>
"><span id="section_name"><a href="javascript:chooseSection();"><?php 
        echo $section_name;
        ?>
</a></span></th>
										<td><a href="javascript:chooseSection();">..</a></td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
					<?php 
    }
    ?>
					
					<?php 
    ########### page template  ########
    ?>
					<table cellpadding="0" cellspacing="0" class="form_row">
						<tr>
							<td class="label"><label><?php 
    echo $site->sys_sona(array('sona' => 'page template', 'tyyp' => 'editor'));
    ?>
:</label></td>
							<td class="input"><select class="select" name="page_ttyyp_id"><option value="0"><?php 
    echo $site->sys_sona(array('sona' => 'default', 'tyyp' => 'admin'));
    ?>
 (<?php 
    echo $default_page_template['name'];
    ?>
)</option>
							<?php 
    foreach ($page_templates as $template_group_name => $templates_group) {
        ?>
								<optgroup label="<?php 
        echo $template_group_name;
        ?>
">
							<?php 
        foreach ($templates_group as $template_id => $template) {
            ?>
									<option value="<?php 
            echo $template_id;
            ?>
"<?php 
            echo $objekt->all['page_ttyyp_id'] == $template_id ? ' selected="selected" style="color: #a7a6aa;"' : '';
            ?>
><?php 
            echo $template['nimi'];
            ?>
</option>
							<?php 
        }
        ?>
								</optgroup>
							<?php 
    }
    ?>
							</select></td>
						</tr>
					</table>
					
					<?php 
    ########### hiding in menu and mailinglist  ########
    ?>
					<table cellpadding="0" cellspacing="0" class="form_row">
						<tr>
							<td class="label">&nbsp;</td>
							<td><input type="checkbox" class="checkbox" id="hide_in" name="is_hided_in_menu" value="1"<?php 
    echo $objekt->all['is_hided_in_menu'] ? ' checked="checked"' : '';
    ?>
 /></td>
							<td width="145"><label for="hide_in"><?php 
    echo $site->sys_sona(array('sona' => 'Hide in menu', 'tyyp' => 'editor'));
    ?>
</label></td>
							<td><input type="checkbox" class="checkbox" id="add_mailinglist" name="on_meilinglist" value="1"<?php 
    echo $objekt->all['on_meilinglist'] ? ' checked="checked"' : '';
    ?>
 /></td>
							<td><label for="add_mailinglist"><?php 
    echo $site->sys_sona(array('sona' => 'On meilinglist', 'tyyp' => 'editor'));
    ?>
</label></td>
						</tr>
					</table>
					
					<table cellpadding="0" cellspacing="0" class="form_row">
						<tr>
							<td class="label">&nbsp;</td>
							<td><label><?php 
    echo $site->sys_sona(array('sona' => 'Avaldatud', 'tyyp' => 'editor'));
    ?>
:</label></td>
							<td><input type="text" id="publish_start" name="avaldamise_algus" maxlength="16" class="text_date" value="<?php 
    echo $publish_start;
    ?>
" /></td>
							<td><a href="javascript:init_datepicker('publish_start', 'publish_start', 'publish_end');"><img src="<?php 
    echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
    ?>
/gfx/calendar/cal.gif" width="16" height="15" title="Choose from calendar" alt="Choose from calendar" /></a></td>
							<td><label><?php 
    echo $site->sys_sona(array('sona' => 'Kuni', 'tyyp' => 'editor'));
    ?>
:</label></td>
							<td><input type="text" id="publish_end" name="avaldamise_lopp" maxlength="16" class="text_date" value="<?php 
    echo $publish_end;
    ?>
" /></td>
							<td><a href="javascript:init_datepicker('publish_end', 'publish_start', 'publish_end');"><img src="<?php 
    echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
    ?>
/gfx/calendar/cal.gif" width="16" height="15" title="Choose from calendar" alt="Choose from calendar" /></a></td>
						</tr>
					</table>
					
					<?########### ONLY FOR SAURUS 3 BUILT-IN TEMPLATES: subarticles +  Add print icon  ########?>
					<?if(($objekt || $site->fdat['refresh']) && $ttyyp['ttyyp_id'] > 0 && $ttyyp['ttyyp_id'] < 1000) { # if ver3 content template?>
					<table cellpadding="0" cellspacing="0" class="form_row">
			              <tr> 
							<td class="label">&nbsp;</td>
			
							<?########### subarticles  ########?>
			                <td><input type="checkbox" id="on_alamartiklid" name="on_alamartiklid"<?php 
    echo $objekt->all['on_alamartiklid'] ? ' checked="checked"' : '';
    ?>
 /></td>
			                <td width="145"><label for="on_alamartiklid"><?php 
    echo $site->sys_sona(array('sona' => 'Naita alamartiklid', 'tyyp' => 'editor'));
    ?>
</label></td>
			
							<?########### Add print icon  ########?>
			                <td><input type="checkbox" id="on_printlink" name="on_printlink"  value="1" <?php 
    echo $objekt->all['on_printlink'] ? ' checked="checked"' : '';
    ?>
 /></td>
			                <td><label for="on_printlink"><?php 
    echo $site->sys_sona(array('sona' => 'Naita prindi ikoon', 'tyyp' => 'editor'));
    ?>
</label></td>
			
						  </tr>
					</table>
					<?} # if ver3 content template?>
					<?php 
    if ($template_variable_html) {
        ?>
					<table cellpadding="0" cellspacing="0" class="form_row">
						<?php 
        echo $template_variable_html;
        ?>
					</table>
					<?php 
    }
    ?>
					
					<?php 
    ########### position  ########
    ?>
					<?php 
    if ($site->CONF['allow_change_position']) {
        ?>
					<table cellpadding="0" cellspacing="0" class="form_row">
						<tr>
							<td class="label"><label><?php 
        echo $site->sys_sona(array('sona' => 'Position', 'tyyp' => 'editor'));
        ?>
:</label></td>
							<td><input type="text" maxlength="5" class="text_position" name="kesk" value="<?php 
        echo $site->fdat['op'] == 'edit' ? $objekt->all['kesk'] : $site->fdat['kesk'];
        ?>
" /></td>
						</tr>
					</table>
					<?php 
    } else {
        ?>
						<input type="hidden" name="kesk" value="<?php 
        echo $site->fdat['op'] == 'edit' ? $objekt->all['kesk'] : $site->fdat['kesk'];
        ?>
" />
					<?php 
    }
    ?>
					
				</div>
			</div>
			
		</div>
		
		<div id="button_container">
			
			<table width="100%" cellspacing="0" cellpadding="0">
				<tbody>
					<tr>
						<td align="left">
							<input type="button" class="button" value="<?php 
    echo $site->sys_sona(array('sona' => 'Apply', 'tyyp' => 'editor'));
    ?>
" onclick="saveForm('save');" />
						</td>
						<td align="right">
							<input type="button" class="button" value="&nbsp;&nbsp;&nbsp;&nbsp;<?php 
    echo $site->sys_sona(array('sona' => 'save_and_close', 'tyyp' => 'editor'));
    ?>
&nbsp;&nbsp;&nbsp;&nbsp;" onclick="saveForm('saveclose');" />
							<input type="button" class="button" value="<?php 
    echo $site->sys_sona(array('sona' => 'Close', 'tyyp' => 'editor'));
    ?>
" onclick="window.close();" />		
						</td>
					</tr>
				</tr>
				</tbody>
			</table>
			
			
			
			
		</div>
		
		</div> <!-- / size_wrapper -->
		
		</form>
	</body>
</html>

<?php 
}
Example #6
0
 private function render()
 {
     require get_templates('usermanage.htm');
 }
Example #7
0
        save_template();
        break;
    case 'saveresponse':
        save_response();
        break;
    case 'get_surveys':
        get_surveys();
        break;
    case 'gettemplatedetail':
        get_template_detail();
        break;
    case 'markcomplete':
        mark_complete();
        break;
    case 'get_templates':
        get_templates();
        break;
    case 'save_selection':
        save_selection();
        break;
    default:
        echo "fell through switch with action = {$action}";
}
function delete_template()
{
    global $conn;
    global $template_id;
    $qry = "{call dbo.sp_delete_template(?)}";
    $params = array($template_id);
    $rst = sqlsrv_query($conn, $qry, $params);
    $returnData['dataDestination'] = 'update';
 private function render()
 {
     require get_templates('AjaxGameManage.html');
 }
Example #9
0
 private function render()
 {
     require get_templates('EditLink.html');
 }
Example #10
0
     $import_wdgt = new CWidget();
     $import_wdgt->addPageHeader(_('SNMP Builder'), $form);
     $data = array();
     $data['form'] = get_request('form');
     $data['widget'] = $import_wdgt;
     $importForm = new CView('administration.snmp_builder', $data);
     $import_wdgt->addItem($importForm->render());
     $import_wdgt->show();
 } else {
     $snmp_wdgt = new CWidget();
     $message_div = new CDiv();
     $message_div->setAttribute("id", "message");
     $snmp_wdgt->addItem($message_div);
     // Template selector
     $cmbTemplates = new CComboBox('templateid', $templateid);
     foreach (get_templates() as $temp) {
         $cmbTemplates->addItem($temp['key'], $temp['host']);
     }
     $form->addItem(array(_('Template') . ':' . SPACE, $cmbTemplates, SPACE));
     //Mib selector
     $cmbMibs = new CComboBox('mib', $mib, 'javascript: submit();');
     $paths = explode(':', MIBS_ALL_PATH);
     foreach ($paths as $path) {
         $cmbMibs->addItem('', '---' . $path);
         foreach (glob($path . "/*.txt") as $filename) {
             $modulename = get_module_name($filename);
             if ($modulename) {
                 $cmbMibs->addItem($modulename, $modulename);
             }
         }
         foreach (glob($path . "/*.mib") as $filename) {
 private function render()
 {
     require get_templates('AjaxClassList.html');
 }
Example #12
0
function productupgrade()
{
    global $_ONAPPVARS, $_LANG;
    $onapp_config = get_onapp_config($_ONAPPVARS['service']['serverid']);
    $service = $_ONAPPVARS['service'];
    $templates = get_templates($service['serverid'], $service["configoption2"]);
    if (!is_null($_ONAPPVARS['vm']->error)) {
        $_ONAPPVARS['error'] = is_array($_ONAPPVARS['vm']->error) ? implode(', ', $_ONAPPVARS['vm']->error) : $_ONAPPVARS['vm']->error;
        clientareaproducts();
    } elseif (is_null($_ONAPPVARS['vm']->_id)) {
        $_ONAPPVARS['error'] = sprintf($_LANG["onappvmnotfoundonserver"], $_ONAPPVARS['service']['vmid'], $onapp_config["adress"]);
        clientareaproducts();
    } else {
        show_template("onapp/clientareaupgrade", array('templates' => $templates, 'virtualmachine' => $_ONAPPVARS['vm']->_obj, 'service' => $service, 'configoptions' => $service['configoptions'], 'id' => $_ONAPPVARS['id'], 'error' => isset($_ONAPPVARS['error']) ? $_ONAPPVARS['error'] : NULL));
    }
}
Example #13
0
            DB::insert('common_setting', array('skey' => 'aliyun_oss', 'svalue' => $aliyun_oss), false, true);
        }
        if (!empty($server_mail)) {
            $server_mail = json_encode($server_mail);
            DB::insert('common_setting', array('skey' => 'server_mail', 'svalue' => $server_mail), false, true);
        }
        if (!empty($server_upload)) {
            $server_upload = json_encode($server_upload);
            DB::insert('common_setting', array('skey' => 'server_upload', 'svalue' => $server_upload), false, true);
        }
        updatecache(array('setting'));
        echo '{
            "statusCode":"200",
            "message":"操作成功",
            "navTabId":"",
            "rel":"",
            "callbackType":"",
            "forwardUrl":"",
            "confirmMsg":""
        }';
        break;
    default:
        $sitename = $_G['setting']['sitename'];
        $sitedomain = $_G['setting']['sitedomain'];
        $seokeywords = $_G['setting']['seokeywords'];
        $seodescription = $_G['setting']['seodescription'];
        $site_icp = $_G['setting']['site_icp'];
        //获取模版目录模版
        $tpldir_array = get_templates();
        include template('admin/baseset/baseset');
}
Example #14
0
 private function render()
 {
     require get_templates('game.html');
 }
Example #15
0
 private function render()
 {
     require get_templates('NewsList.html');
 }