<?php /* Smarty version 2.6.25, created on 2012-07-15 10:33:27
         compiled from DefaultAdmin/dir_widgets.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'escape', 'DefaultAdmin/dir_widgets.tpl', 102, false),array('modifier', 'trim', 'DefaultAdmin/dir_widgets.tpl', 102, false),array('function', 'cycle', 'DefaultAdmin/dir_widgets.tpl', 122, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "messages.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<?php echo '
<script type="text/javascript">
function status_hide(id) {
	var display = document.getElementById(\'list-status-\'+id).style.display;
	if (display == \'none\') {
		document.getElementById(\'list-status-\'+id).style.display = \'block\';
	} else {
		document.getElementById(\'list-status-\'+id).style.display = \'none\';
	}
	return false;
}
function getPosition(e, id) {
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + 
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + 
            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }

    document.getElementById(id).style.top = eval(cursor.y+1)+\'px\';
	document.getElementById(id).style.left = eval(cursor.x)+\'px\';
}

function select_all(key,all) {

	if (document.getElementsByClassName == undefined) {
	document.getElementsByClassName = function(className)
	{
		var hasClassName = new RegExp("(?:^|\\\\s)" + className + "(?:$|\\\\s)");
		var allElements = document.getElementsByTagName("*");
		var results = [];

		var element;
		for (var i = 0; (element = allElements[i]) != null; i++) {
			var elementClass = element.className;
			if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass))
				results.push(element);
		}

		return results;
	}
	}	

	var elem = document.getElementsByClassName(key);
	if (all == 1) {
		for (var i in elem) {
			elem[i].checked=true;
		}
	} else {
		for (var i in elem) {
			elem[i].checked=false;
		}
	}
}
</script>
'; ?>

<?php echo ''; ?><?php if ($this->_tpl_vars['wid_message'] != ''): ?><?php echo '<div class="success block">'; ?><?php echo $this->_tpl_vars['wid_message']; ?><?php echo '</div>'; ?><?php endif; ?><?php echo ''; ?><?php if ($this->_tpl_vars['wid_error'] != ''): ?><?php echo '<div class="block"><div class="error">'; ?><?php echo $this->_tpl_vars['wid_error']; ?><?php echo '</div></div>'; ?><?php endif; ?><?php echo ''; ?><?php if ($this->_tpl_vars['op_status'] == 1): ?><?php echo '<div class="success block">Operation successful.</div>'; ?><?php elseif ($this->_tpl_vars['op_status'] == -1): ?><?php echo '<div class="block"><div class="error"><h2>Error</h2><p>Some errors occured during the operation.</p></div></div>'; ?><?php endif; ?><?php echo '<div class="block"><form action="'; ?><?php echo @DOC_ROOT; ?><?php echo '/dir_widgets_edit.php" method="post">'; ?><?php $_from = $this->_tpl_vars['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['type']):
?><?php echo '<table class="list" style="margin-bottom: 30px;"><thead><tr><th class="listHeader" colspan="'; ?><?php echo $this->_tpl_vars['col_count']; ?><?php echo '">'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['key'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo ' WIDGETS : Can be placed on the following zones:&nbsp;'; ?><?php unset($this->_sections['i']);
$this->_sections['i']['name'] = 'i';
$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['available'][$this->_tpl_vars['key']]) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['i']['show'] = true;
$this->_sections['i']['max'] = $this->_sections['i']['loop'];
$this->_sections['i']['step'] = 1;
$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
if ($this->_sections['i']['show']) {
    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
    if ($this->_sections['i']['total'] == 0)
        $this->_sections['i']['show'] = false;
} else
    $this->_sections['i']['total'] = 0;
if ($this->_sections['i']['show']):

            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
?><?php echo '<a style="display: inline;" href="'; ?><?php echo @DOC_ROOT; ?><?php echo '/dir_widgets_per_zone.php?Z='; ?><?php echo $this->_tpl_vars['available'][$this->_tpl_vars['key']][$this->_sections['i']['index']]['NAME']; ?><?php echo '&T='; ?><?php echo $this->_tpl_vars['key']; ?><?php echo '">'; ?><?php echo $this->_tpl_vars['available'][$this->_tpl_vars['key']][$this->_sections['i']['index']]['NAME']; ?><?php echo '</a>'; ?><?php if (! $this->_sections['i']['last']): ?><?php echo ',&nbsp;'; ?><?php endif; ?><?php echo ''; ?><?php endfor; endif; ?><?php echo '</th></tr><tr><th class="listHeader">&nbsp;</th>'; ?><?php $_from = $this->_tpl_vars['columns']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['col'] => $this->_tpl_vars['name']):
?><?php echo ''; ?><?php if ($this->_tpl_vars['col'] != 'TITLE_URL'): ?><?php echo '<th class="listHeader">'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo '</th>'; ?><?php endif; ?><?php echo ''; ?><?php endforeach; endif; unset($_from); ?><?php echo '</tr></thead><tbody>'; ?><?php $_from = $this->_tpl_vars['type']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['widgets'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['widgets']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['NAME'] => $this->_tpl_vars['row']):
        $this->_foreach['widgets']['iteration']++;
?><?php echo '<tr class="'; ?><?php echo smarty_function_cycle(array('values' => "odd,even"), $this);?><?php echo '"><td class="first-child" style="width: 25px;"><label><input type="checkbox" name="multi-'; ?><?php echo $this->_tpl_vars['row']['NAME']; ?><?php echo '" class="'; ?><?php echo $this->_tpl_vars['key']; ?><?php echo '" id="multi-'; ?><?php echo $this->_tpl_vars['row']['NAME']; ?><?php echo '" title="Check box to select this item." /></label></td>'; ?><?php $_from = $this->_tpl_vars['columns']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['col'] => $this->_tpl_vars['name']):
?><?php echo ''; ?><?php $this->assign('val', $this->_tpl_vars['row'][$this->_tpl_vars['col']]); ?><?php echo ''; ?><?php if ($this->_tpl_vars['col'] == 'INSTALLED'): ?><?php echo '<td '; ?><?php if ($this->_tpl_vars['row'][$this->_tpl_vars['col']] == '1'): ?><?php echo 'class="status-2"'; ?><?php else: ?><?php echo 'class="status-0"'; ?><?php endif; ?><?php echo '>'; ?><?php if ($this->_tpl_vars['row'][$this->_tpl_vars['col']] == '1'): ?><?php echo '<span class="link-status pop">Installed</span><h3 id="chgStat-'; ?><?php echo $this->_tpl_vars['row']['NAME']; ?><?php echo '" class="chgStatTitle" onclick="'; ?><?php echo 'return status_hide(\''; ?><?php echo ''; ?><?php echo $this->_tpl_vars['row']['NAME']; ?><?php echo ''; ?><?php echo '\');'; ?><?php echo '">Change status</h3><ul id="list-status-'; ?><?php echo $this->_tpl_vars['row']['NAME']; ?><?php echo '" style="display: none;"><li><a class="new-status-0" href="'; ?><?php echo @DOC_ROOT; ?><?php echo '/dir_widgets_edit.php?action=U:'; ?><?php echo $this->_tpl_vars['row']['NAME']; ?><?php echo '" title="Uninstall widget: '; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['row']['NAME'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo '">Uninstall</a></li></ul>'; ?><?php else: ?><?php echo '<span class="link-status pop">Not Installed</span><h3 id="chgStat-'; ?><?php echo $this->_tpl_vars['row']['NAME']; ?><?php echo '" class="chgStatTitle" onclick="'; ?><?php echo 'return status_hide(\''; ?><?php echo ''; ?><?php echo $this->_tpl_vars['row']['NAME']; ?><?php echo ''; ?><?php echo '\');'; ?><?php echo '">Change status</h3><ul id="list-status-'; ?><?php echo $this->_tpl_vars['row']['NAME']; ?><?php echo '" style="display: none;"><li><a class="new-status-2" href="'; ?><?php echo @DOC_ROOT; ?><?php echo '/dir_widgets_edit.php?action=I:'; ?><?php echo $this->_tpl_vars['row']['NAME']; ?><?php echo '" title="Install widget: '; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['row']['NAME'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo '">Install</a></li></ul>'; ?><?php endif; ?><?php echo '</td>'; ?><?php elseif ($this->_tpl_vars['col'] == 'ACTION'): ?><?php echo '<td style="width: 20px;">'; ?><?php if ($this->_tpl_vars['row']['INSTALLED'] == '1'): ?><?php echo '<a href="'; ?><?php echo @DOC_ROOT; ?><?php echo '/dir_widgets_edit.php?action=E:'; ?><?php echo $this->_tpl_vars['row']['NAME']; ?><?php echo '" title="Edit settings for: '; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['row']['NAME'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo '" class="action edit"><span>EDIT SETTINGS</span></a>'; ?><?php endif; ?><?php echo '</td>'; ?><?php elseif ($this->_tpl_vars['col'] == 'NAME'): ?><?php echo '<td><a href="" style="border: none; text-decoration: underline;" onmouseover="'; ?><?php echo 'document.getElementById(\'wid_details_'; ?><?php echo ''; ?><?php echo $this->_tpl_vars['row'][$this->_tpl_vars['col']]; ?><?php echo ''; ?><?php echo '\').style.display=\'block\'; getPosition(event, \'wid_details_'; ?><?php echo ''; ?><?php echo $this->_tpl_vars['row'][$this->_tpl_vars['col']]; ?><?php echo ''; ?><?php echo '\');'; ?><?php echo '" onmouseout="'; ?><?php echo 'document.getElementById(\'wid_details_'; ?><?php echo ''; ?><?php echo $this->_tpl_vars['row'][$this->_tpl_vars['col']]; ?><?php echo ''; ?><?php echo '\').style.display=\'none\';'; ?><?php echo '" onclick="return false;">'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['row'][$this->_tpl_vars['col']])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo '</a><span id="wid_details_'; ?><?php echo $this->_tpl_vars['row'][$this->_tpl_vars['col']]; ?><?php echo '" class="wid_details" style="display: none;">'; ?><?php if (((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['row']['DESCRIPTION'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)) != ''): ?><?php echo ''; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['row']['DESCRIPTION'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo ''; ?><?php else: ?><?php echo 'No description.'; ?><?php endif; ?><?php echo '</span></td>'; ?><?php else: ?><?php echo '<td>'; ?><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['row'][$this->_tpl_vars['col']])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)))) ? $this->_run_mod_handler('trim', true, $_tmp) : trim($_tmp)); ?><?php echo '</td>'; ?><?php endif; ?><?php echo ''; ?><?php endforeach; endif; unset($_from); ?><?php echo '</tr>'; ?><?php endforeach; else: ?><?php echo '<tr><td colspan="'; ?><?php echo $this->_tpl_vars['col_count']; ?><?php echo '" class="norec">No records found.</td></tr>'; ?><?php endif; unset($_from); ?><?php echo '</tbody></table><table class="list"><tr><td colspan="2" style="font-weight: bold; text-align: center;">Manage multiple selections</td></tr><tr><td><fieldset class="link_action"><legend>Select</legend><input type="button" name="all" id="allButton" value="All" title="Select All" class="button" onclick="'; ?><?php echo 'select_all(\''; ?><?php echo ''; ?><?php echo $this->_tpl_vars['key']; ?><?php echo ''; ?><?php echo '\', 1);'; ?><?php echo '" /><input type="button" name="none" id="noneButton" value="None" title="Select None" class="button" onclick="'; ?><?php echo 'select_all(\''; ?><?php echo ''; ?><?php echo $this->_tpl_vars['key']; ?><?php echo ''; ?><?php echo '\', 0);'; ?><?php echo '" /></fieldset><fieldset class="link_action"><legend>Change Status</legend><input type="submit" name="install" id="installButton" value="Install" title="Install selected widgets" class="button"/><input type="submit" name="uninstall" id="uninstallButton" value="Uninstall" title="Uninstall selected widgets" class="button"/><input type="hidden" name="action" value="multi"/><input type="hidden" name="type" value="'; ?><?php echo $this->_tpl_vars['key']; ?><?php echo '"/></fieldset></td></tr></table>'; ?><?php endforeach; endif; unset($_from); ?><?php echo '</form></div>'; ?>
