<commit_before><?php defined('ROOT') or die('No direct script access.');
/**
 * X3 CMS - A smart Content Management System
 *
 * @author		<NAME>
 * @copyright	(c) CBlu.net di <NAME>
 * @license		http://www.gnu.org/licenses/agpl.htm
 * @package		X3CMS
 */

// language switcher
if (MULTILANGUAGE) 
{
	echo '<div class="aright sbox"><ul class="inline-list">';
	foreach($langs as $i) 
	{
		$on = ($i->code == $page->lang) ? 'class="on"' : '';
		echo '<li><a '.$on.' href="'.BASE_URL.'pages/index/'.$page->id_area.'/'.$i->code.'/home/1" title="'._SWITCH_LANGUAGE.'">'.ucfirst($i->language).'</a></li>';
	}
	echo '</ul></div>';
}

// area switcher
echo '<div class="aright sbox"><ul class="inline-list">';
foreach($areas as $i) 
{
	$on = ($i->id == $id_area) ? 'class="on"' : '';
	echo '<li><a '.$on.' href="'.BASE_URL.'pages/index/'.$i->id.'/'.$lang.'/home/1" title="'._SWITCH_AREA.'">'.ucfirst($i->name).'</a></li>';
}
echo '</ul></div>';

// to avoid slash problems
$xfrom = str_replace('/', '§', $page->url);

?>
<h1><?php echo _PAGE_LIST.' \''.$area.'\''._TRAIT_._LANGUAGE.' \''.$lang ?>'</h1>
<p><?php echo _MENU_AND_ORDER ?></p>
<?php

// do not delete pages
$no_del = array('home', 'msg', 'search', 'logout', 'offline');

// do not move pages
$no_menu = array('home', 'msg', 'search', 'offline', 'x3admin');

if (isset($page->url) && $page->url != 'home') 
{
	// parent page
	$parent = str_replace('/', '§', $page->xfrom);
	echo '<p><a class="btm" href="'.BASE_URL.'pages/index/'.$page->id_area.'/'.$page->lang.'/'.$parent.'/1" title="'._GO_BACK.'"><i class="fa fa-arrow-left lg"></i> '.stripslashes($page->name).'</a></p>';
}

// menu arrangement
$m = array();
if ($page->url == 'home') 
{
	foreach($menus as $i) 
	{
		$m[$i->id] = $i->description;
	}
}
else 
{
	foreach($menus as $i) 
	{
		if ($i->id == $page->id_menu) $m[$i->id] = $i->description;
	}
}

if (!empty($pages)) 
{
	
	// ids item
	$ids = array();
	// sortable item
	$sort = array();
	
	echo '<form id="menu_manager">
			<input type="hidden" name="id_area" id="id_area" value="'.$page->id_area.'" />
			<input type="hidden" name="lang" id="lang" value="'.$page->lang.'" />
			<input type="hidden" name="xfrom" id="xfrom" value="'.$page->url.'" />
		<div class="titlebar">'.ucfirst(_PAGES).'</div><ul class="nomargin zebra min-height" id="m0">';
	$sort[0] = '#m0';
	$memo = $c = 0;
	foreach($pages as $i)
	{
		if ($i->url != 'x3admin') {
			if ($i->xon) 
			{
				$status = _ON;
				$on_status = 'orange';
			}
			else 
			{
				$status = _OFF;
				$on_status = 'gray';
			}
			
			if ($i->xlock) 
			{
				$lock = _LOCKED;
				$lock_status = 'lock';
			}
			else 
			{
				$lock = _UNLOCKED;
				$lock_status = 'unlock-alt';
			}
			
			$actions = $delete = '';
			
			// check permission
			if (($i->level > 1 && $i->xlock == 0) || $i->level == 4) {
				$actions = (ADVANCED_EDITING) ?
					'<a class="btm" href="'.BASE_URL.'sections/compose/'.$i->id.'" title="'._EDIT.'"><i class="fa fa-pencil fa-lg"></i></a>' :
					'<a class="btm2" href="'.BASE_URL.'articles/edit/'.$i->id_area.'/'.$i->lang.'/1/0/'.$i->id.'" title="'._EDIT.'"><i class="fa fa-pencil fa-lg"></i></a>';
				
				// manager user
				if ($i->level > 2) 
				{
					$actions .= (in_array($i->url, $no_del)) 
						? '<a><i class="fa fa-lightbulb-o fa-lg invisible"></i></a>' 
						: '<a class="btl" href="'.BASE_URL.'pages/set/xon/'.$i->id.'/'.(($i->xon+1)%2).'" title="'._STATUS.' '.$status.'"><i class="fa fa-lightbulb-o fa-lg '.$on_status.'"></i></a>';
						
					$actions .= ' <a class="bta" href="'.BASE_URL.'pages/seo/'.$i->id.'" title="'._SEO_TOOLS.'"><i class="fa fa-cogs fa-lg"></i></a>' ;
					
					if ($area != 'admin')
					{
					    $actions .= '<a class="bta" href="'.BASE_URL.'x3pages/edit/'.$i->id_area.'/'.$i->lang.'/'.$i->id.'/'.$i->url.'" title="'._EDIT.'"><i class="fa fa-bars fa-lg"></i></a> ';
					}
					// admin user
					if ($i->level == 4) 
					{
						$delete = '<a class="btl" href="'.BASE_URL.'pages/set/xlock/'.$i->id.'/'.(($i->xlock+1)%2).'" title="'._STATUS.' '.$lock.'"><i class="fa fa-'.$lock_status.' fa-lg"></i></a>';
						
						if (!in_array($i->url, $no_del)) 
						{
							$delete .= ' <a class="bta" href="'.BASE_URL.'pages/delete/'.$i->id.'" title="'._DELETE.'"><i class="fa fa-trash fa-lg red"></i></a>';
						}
						else
						{
							$delete .= ' <a><i class="fa fa-trash fa-lg invisible"></i></a>';
						}
					}
				}
			}
			
			// menus
			if ($memo != $i->id_menu && isset($m[$i->id_menu])) 
			{
				// check if is the next menu
				foreach($m as $k => $v)
				{
					echo '</ul>
						<input type="hidden" name="sort'.$c.'" id="sort'.$c.'" value="'.implode(', ', $ids).'" />
						<div class="titlebar">'._MENU.': '.stripslashes($v).'</div><ul class="nomargin zebra min-height" id="m'.$k.'">';
					$c++;<commit_msg>removed unused code<commit_after><?php defined('ROOT') or die('No direct script access.');
/**
 * X3 CMS - A smart Content Management System
 *
 * @author		<NAME>
 * @copyright	(c) CBlu.net di Paolo Certo
 * @license		http://www.gnu.org/licenses/agpl.htm
 * @package		X3CMS
 */

// language switcher
if (MULTILANGUAGE) 
{
	echo '<div class="aright sbox"><ul class="inline-list">';
	foreach($langs as $i) 
	{
		$on = ($i->code == $page->lang) ? 'class="on"' : '';
		echo '<li><a '.$on.' href="'.BASE_URL.'pages/index/'.$page->id_area.'/'.$i->code.'/home/1" title="'._SWITCH_LANGUAGE.'">'.ucfirst($i->language).'</a></li>';
	}
	echo '</ul></div>';
}

// area switcher
echo '<div class="aright sbox"><ul class="inline-list">';
foreach($areas as $i) 
{
	$on = ($i->id == $id_area) ? 'class="on"' : '';
	echo '<li><a '.$on.' href="'.BASE_URL.'pages/index/'.$i->id.'/'.$lang.'/home/1" title="'._SWITCH_AREA.'">'.ucfirst($i->name).'</a></li>';
}
echo '</ul></div>';

// to avoid slash problems
$xfrom = str_replace('/', '§', $page->url);

?>
<h1><?php echo _PAGE_LIST.' \''.$area.'\''._TRAIT_._LANGUAGE.' \''.$lang ?>'</h1>
<p><?php echo _MENU_AND_ORDER ?></p>
<?php

// do not delete pages
$no_del = array('home', 'msg', 'search', 'logout', 'offline');

// do not move pages
$no_menu = array('home', 'msg', 'search', 'offline', 'x3admin');

if (isset($page->url) && $page->url != 'home') 
{
	// parent page
	$parent = str_replace('/', '§', $page->xfrom);
	echo '<p><a class="btm" href="'.BASE_URL.'pages/index/'.$page->id_area.'/'.$page->lang.'/'.$parent.'/1" title="'._GO_BACK.'"><i class="fa fa-arrow-left lg"></i> '.stripslashes($page->name).'</a></p>';
}

// menu arrangement
$m = array();
if ($page->url == 'home') 
{
	foreach($menus as $i) 
	{
		$m[$i->id] = $i->description;
	}
}
else 
{
	foreach($menus as $i) 
	{
		if ($i->id == $page->id_menu) $m[$i->id] = $i->description;
	}
}

if (!empty($pages)) 
{
	
	// ids item
	$ids = array();
	// sortable item
	$sort = array();
	
	echo '<form id="menu_manager">
			<input type="hidden" name="id_area" id="id_area" value="'.$page->id_area.'" />
			<input type="hidden" name="lang" id="lang" value="'.$page->lang.'" />
			<input type="hidden" name="xfrom" id="xfrom" value="'.$page->url.'" />
		<div class="titlebar">'.ucfirst(_PAGES).'</div><ul class="nomargin zebra min-height" id="m0">';
	$sort[0] = '#m0';
	$memo = $c = 0;
	foreach($pages as $i)
	{
		if ($i->url != 'x3admin') {
			if ($i->xon) 
			{
				$status = _ON;
				$on_status = 'orange';
			}
			else 
			{
				$status = _OFF;
				$on_status = 'gray';
			}
			
			if ($i->xlock) 
			{
				$lock = _LOCKED;
				$lock_status = 'lock';
			}
			else 
			{
				$lock = _UNLOCKED;
				$lock_status = 'unlock-alt';
			}
			
			$actions = $delete = '';
			
			// check permission
			if (($i->level > 1 && $i->xlock == 0) || $i->level == 4) {
				$actions = (ADVANCED_EDITING) ?
					'<a class="btm" href="'.BASE_URL.'sections/compose/'.$i->id.'" title="'._EDIT.'"><i class="fa fa-pencil fa-lg"></i></a>' :
					'<a class="btm2" href="'.BASE_URL.'articles/edit/'.$i->id_area.'/'.$i->lang.'/1/0/'.$i->id.'" title="'._EDIT.'"><i class="fa fa-pencil fa-lg"></i></a>';
				
				// manager user
				if ($i->level > 2) 
				{
					$actions .= (in_array($i->url, $no_del)) 
						? '<a><i class="fa fa-lightbulb-o fa-lg invisible"></i></a>' 
						: '<a class="btl" href="'.BASE_URL.'pages/set/xon/'.$i->id.'/'.(($i->xon+1)%2).'" title="'._STATUS.' '.$status.'"><i class="fa fa-lightbulb-o fa-lg '.$on_status.'"></i></a>';
						
					$actions .= ' <a class="bta" href="'.BASE_URL.'pages/seo/'.$i->id.'" title="'._SEO_TOOLS.'"><i class="fa fa-cogs fa-lg"></i></a>' ;
					
					// admin user
					if ($i->level == 4) 
					{
						$delete = '<a class="btl" href="'.BASE_URL.'pages/set/xlock/'.$i->id.'/'.(($i->xlock+1)%2).'" title="'._STATUS.' '.$lock.'"><i class="fa fa-'.$lock_status.' fa-lg"></i></a>';
						
						if (!in_array($i->url, $no_del)) 
						{
							$delete .= ' <a class="bta" href="'.BASE_URL.'pages/delete/'.$i->id.'" title="'._DELETE.'"><i class="fa fa-trash fa-lg red"></i></a>';
						}
						else
						{
							$delete .= ' <a><i class="fa fa-trash fa-lg invisible"></i></a>';
						}
					}
				}
			}
			
			// menus
			if ($memo != $i->id_menu && isset($m[$i->id_menu])) 
			{
				// check if is the next menu
				foreach($m as $k => $v)
				{
					echo '</ul>
						<input type="hidden" name="sort'.$c.'" id="sort'.$c.'" value="'.implode(', ', $ids).'" />
						<div class="titlebar">'._MENU.': '.stripslashes($v).'</div><ul class="nomargin zebra min-height" id="m'.$k.'">';
					$c++;
{'fraction_non_alphanumeric': 0.2892921574869999, 'fraction_numerical': 0.005412289079910856, 'mean_word_length': 2.969671440606571, 'pattern_counts': {'":': 0, '<': 158, '<?xml version=': 0, '>': 260, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4211201', 'n_tokens_mistral': 4358, 'n_tokens_neox': 3832, 'n_words': 685}