'); if (count($ids) != 0) { $ct = 0; $coArray = array(); foreach ($ids as $id) { if ($title[$ct] != null) { if ( $slug[$ct] == null ) { $slug_tmp = to7bit($title[$ct], 'UTF-8'); $slug[$ct] = clean_url($slug_tmp); $slug_tmp = ''; } $coArray[$ct]['id'] = $ids[$ct]; $coArray[$ct]['slug'] = $slug[$ct]; $coArray[$ct]['title'] = safe_slash_html($title[$ct]); $coArray[$ct]['value'] = safe_slash_html($value[$ct]); } $ct++; } $ids = subval_sort($coArray,'title'); $count = 0; foreach ($ids as $comp) { # create the body of components.xml file $components = $xml->addChild('item'); $c_note = $components->addChild('title'); $c_note->addCData($comp['title']); $components->addChild('slug', $comp['slug']); $c_note = $components->addChild('value'); $c_note->addCData($comp['value']); $count++; } } exec_action('component-save'); XMLsave($xml, $path . $file); redirect('components.php?upd=comp-success'); } # if undo was invoked if (isset($_GET['undo'])) { # check for csrf $nonce = $_GET['nonce']; if(!check_nonce($nonce, "undo")) { die("CSRF detected!"); } # perform the undo undo($file, $path, $bakpath); redirect('components.php?upd=comp-restored'); } # create components form html $data = getXML($path . $file); $componentsec = $data->item; $count= 0; if (count($componentsec) != 0) { foreach ($componentsec as $component) { $table .= '
'; $table .= '
'. stripslashes($component->title) .'<?php get_component(\''.$component->slug.'\'); ?>'; $table .= '×
'; $table .= ''; $table .= ''; $table .= ''; $table .= ''; exec_action('component-extras'); $table .= '
'; $count++; } } # create list to show on sidebar for easy access $listc = ''; $submitclass = ''; if($count > 1) { $item = 0; foreach($componentsec as $component) { $listc .= '' . $component->title . ''; $item++; } } elseif ($count == 0) { $submitclass = 'hidden'; } get_template('header', cl($SITENAME).' » '.i18n_r('COMPONENTS')); ?>

" />

    

'; } ?>