<commit_before><?php
/**
 * menu class.
 *
 * @package Core
 * @license http://www.gnu.org/licenses/agpl-3.0.html
 * @author <NAME> <<EMAIL>>
 * @copyright SciActive.com
 * @link http://sciactive.com/
 */
/* @var $_ core */
defined('P_RUN') or die('Direct access prohibited');

/**
 * The WonderPHP menu system.
 * @package Core
 */
class menu {
	/**
	 * Array of specially formatted menu entries.
	 * @var array
	 */
	public $menu_arrays = array();
	/**
	 * The hierarchical menu array.
	 * @access private
	 * @var array
	 */
	private $menus = array();

	/**
	 * Read JSON formatted menu data from a file.
	 *
	 * All menu entries are added to $this->menu_arrays.
	 *
	 * @param string $filename The path of the file to read.
	 * @return bool True on success, false on failure.
	 */
	public function add_json_file($filename) {
		$array = json_decode(file_get_contents($filename), true);
		if ((array) $array !== $array)
			return false;
		foreach ($array as $value) {
			$this->menu_arrays[] = $value;
		}
		return true;
	}

	/**
	 * Parse the entries and build the menus.
	 *
	 * render() will read and process menu dependencies using
	 * $_->depend->check(), and add each menu to a module in its proper
	 * position. It will then call $_->template->menu() and give the menu
	 * array as an object for each menu. It is the current template's job to
	 * return the code that gets placed into the module's content.
	 *
	 * It will remove entries whose dependencies aren't met and ['path'], and
	 * call $_->template->url with the parameters found in ['href']
	 * variables, if they are an array.
	 *
	 * This is an example of the array passed to $_->template->menu():
	 *
	 * <pre>
	 * Array (
	 *     [0] => Array (
	 *             [text] => Main Menu
	 *             [position] => main_menu
	 *         )
	 *     [com_configure] => Array (
	 *             [0] => Array (
	 *                     [text] => Configuration
	 *                 )
	 *             [components] => Array (
	 *                     [0] => Array (
	 *                             [text] => Components
	 *                             [href] => /pines/index.php/configure/list/
	 *                         )
	 *                 )
	 *         )
	 *     [myaccount] => Array (
	 *             [0] => Array (
	 *                     [text] => My Account
	 *                     [href] => /pines/index.php/user/editself/
	 *                 )
	 *         )
	 *     [logout] => Array (
	 *             [0] => Array (
	 *                     [text] => Logout
	 *                     [href] => /pines/index.php/user/logout/
	 *                     [onclick] => return confirm("Are you sure?");
	 *                 )
	 *         )
	 * )
	 * </pre>
	 */
	public function render() {<commit_msg>Changed some instances of pines to wonder.<commit_after><?php
/**
 * menu class.
 *
 * @package Core
 * @license http://www.gnu.org/licenses/agpl-3.0.html
 * @author <NAME> <<EMAIL>>
 * @copyright SciActive.com
 * @link http://sciactive.com/
 */
/* @var $_ core */
defined('P_RUN') or die('Direct access prohibited');

/**
 * The WonderPHP menu system.
 * @package Core
 */
class menu {
	/**
	 * Array of specially formatted menu entries.
	 * @var array
	 */
	public $menu_arrays = array();
	/**
	 * The hierarchical menu array.
	 * @access private
	 * @var array
	 */
	private $menus = array();

	/**
	 * Read JSON formatted menu data from a file.
	 *
	 * All menu entries are added to $this->menu_arrays.
	 *
	 * @param string $filename The path of the file to read.
	 * @return bool True on success, false on failure.
	 */
	public function add_json_file($filename) {
		$array = json_decode(file_get_contents($filename), true);
		if ((array) $array !== $array)
			return false;
		foreach ($array as $value) {
			$this->menu_arrays[] = $value;
		}
		return true;
	}

	/**
	 * Parse the entries and build the menus.
	 *
	 * render() will read and process menu dependencies using
	 * $_->depend->check(), and add each menu to a module in its proper
	 * position. It will then call $_->template->menu() and give the menu
	 * array as an object for each menu. It is the current template's job to
	 * return the code that gets placed into the module's content.
	 *
	 * It will remove entries whose dependencies aren't met and ['path'], and
	 * call $_->template->url with the parameters found in ['href']
	 * variables, if they are an array.
	 *
	 * This is an example of the array passed to $_->template->menu():
	 *
	 * <pre>
	 * Array (
	 *     [0] => Array (
	 *             [text] => Main Menu
	 *             [position] => main_menu
	 *         )
	 *     [com_configure] => Array (
	 *             [0] => Array (
	 *                     [text] => Configuration
	 *                 )
	 *             [components] => Array (
	 *                     [0] => Array (
	 *                             [text] => Components
	 *                             [href] => /wonder/index.php/configure/list/
	 *                         )
	 *                 )
	 *         )
	 *     [myaccount] => Array (
	 *             [0] => Array (
	 *                     [text] => My Account
	 *                     [href] => /wonder/index.php/user/editself/
	 *                 )
	 *         )
	 *     [logout] => Array (
	 *             [0] => Array (
	 *                     [text] => Logout
	 *                     [href] => /wonder/index.php/user/logout/
	 *                     [onclick] => return confirm("Are you sure?");
	 *                 )
	 *         )
	 * )
	 * </pre>
	 */
	public function render() {
{'fraction_non_alphanumeric': 0.14010097367472052, 'fraction_numerical': 0.0025243418680129825, 'mean_word_length': 1.7271386430678466, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 71, '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': '2191885', 'n_tokens_mistral': 1724, 'n_tokens_neox': 1537, 'n_words': 502}