/** * Get Component * * This will output the component requested. * Components are parsed for PHP within them. * Will only return the first component matching $id * * @since 1.0 * * @param string $id This is the ID of the component you want to display * @param bool $force Force return of disabled components * @param bool $raw do not process php */ function get_component($id, $force = false, $raw = false) { output_collection_item($id, get_components_xml(), $force, $raw); }
/** * Get Component * * This will output the component requested. * Components are parsed for PHP within them. * Will only return the first component matching $id * * @since 1.0 * * @param string $id This is the ID of the component you want to display * @param bool $force Force return of inactive components * @param bool $raw do not process php */ function get_component($id, $force = false, $raw = false) { $components = get_components_xml(); $component = get_component_xml($id); // this returns an array due to no distinct slug enforcement if (!$component) { return; } $enabled = !(bool) ($component[0]->disabled == 'true' || $component[0]->disabled == '1'); if (!$enabled && !$force) { return; } if (!$raw) { eval("?>" . strip_decode($component[0]->value) . "<?php "); } else { echo strip_decode($component[0]->value); } }
/** * get xml for an individual component * returns an array since duplicates are possible on component slugs * * @since 3.4 * * @param str $id component id * @return array of simpleXmlObj matching slug */ function get_component_xml($id) { return get_collection_item($id, get_components_xml()); }
$update = $status ? 'comp-success' : 'error'; } # if undo was invoked if (isset($_GET['undo'])) { # perform the undo restore_datafile(GSDATAOTHERPATH . GSCOMPONENTSFILE); check_for_csrf("undo"); if (!requestIsAjax()) { redirect('components.php?upd=comp-restored'); } // redirect to prevent refresh undos $update = 'comp-restored'; get_components_xml(true); } # create components form html $collectionData = get_components_xml(); $numitems = $collectionData ? count($collectionData) : 0; $pagetitle = i18n_r('COMPONENTS'); get_template('header'); include 'template/include-nav.php'; ?> <div class="bodycontent clearfix"> <div id="maincontent"> <div class="main"> <h3 class="floated"><?php echo i18n_r('EDIT_COMPONENTS'); ?> </h3> <div class="edit-nav clearfix" > <a href="javascript:void(0)" id="addcomponent" accesskey="<?php