Location: PHPKode > scripts > Noostr > style/admin/functions.php
<?php defined('SYSPATH') OR die('No direct access to this file is allowed.');

function get_groups($site) {
	$groups = array();
	foreach ($site as $key => $val) {
		if (strpos($key, '_group') !== false) {
			// Temporary hack to get these groups at the top (or hidden).
			if ($val != 'general' && $val != 'display' && $val != 'private') {
				$groups[] = $val;
			}
		}
	}
	$groups = array_unique($groups);
	sort($groups);
	array_unshift($groups, 'general', 'display');
	return $groups;
}

function get_input($id, $type, $val = null, $values = null) {
	$return = null;
	$class = '';
	switch ($type) {
		case 'int':
			$class = 'low';
		case 'float':
			$class = 'low';
		case 'string':
			if ($class == '') {
				$class = 'med';
			}
			if (strlen($val) > 22) {
				$class = 'hi';
			}
			$return = '<input type="text" name="'.$id.'" id="'.$id.'" value="'.$val.'" class="'.$class.'" />';
			break;
		case 'bool':
			$checked = '';
			if ($val == 1 || $val == true) {
				$checked = ' checked="checked"';
			}
			$return = '<input type="checkbox" value="1" name="'.$id.'" id="'.$id.'"'.$checked.' />';
			break;
	}
	return $return;
}

Return current item: Noostr