public function __invoke() { if (!count($this->args)) { return _make($this->thing); } else { return call_user_func_array('_make', $args); } }
function request($rqst) { array_shift($rqst); $ax = $rqst; foreach ($rqst as $a) { array_shift($ax); if (strpos($a, '-h') !== false || strpos($a, '?') !== false) { return _help(); } if (strpos($a, 'optimize') !== false) { return _optimize(substr($a, 8), $ax); } if (strpos($a, 'key:') !== false) { return _key(substr($a, 4), $ax); } if (strpos($a, 'make:') !== false) { return _make(substr($a, 5), $ax); } } //or show help... return _help(); }
$custom_fields_RET = DBGet(DBQuery('SELECT CONCAT(\'' . '<b>' . '\',sfc.TITLE,\'' . '</b>' . '\') AS CATEGORY,cf.ID,cf.TITLE,\'' . '' . '\' AS SEARCH,\'' . '' . '\' AS DISPLAY FROM custom_fields cf,student_field_categories sfc WHERE sfc.ID=cf.CATEGORY_ID AND (SELECT DISTINCT CAN_USE FROM profile_exceptions WHERE PROFILE_ID=\'' . User('PROFILE_ID') . '\' AND MODNAME=CONCAT(\'' . 'students/Student.php&category_id=' . '\',cf.CATEGORY_ID))=\'' . 'Y' . '\' ORDER BY sfc.SORT_ORDER,sfc.TITLE,cf.SORT_ORDER,cf.TITLE'), array('SEARCH' => '_make', 'DISPLAY' => '_make'), array('CATEGORY')); } else { $profile_id_mod = DBGet(DBQuery("SELECT PROFILE_ID FROM staff WHERE USER_ID='" . User('STAFF_ID'))); $profile_id_mod = $profile_id_mod[1]['PROFILE_ID']; if ($profile_id_mod != '') { $custom_fields_RET = DBGet(DBQuery('SELECT CONCAT(\'' . '<b>' . '\',sfc.TITLE,\'' . '</b>' . '\') AS CATEGORY,cf.ID,cf.TITLE,\'' . '' . '\' AS SEARCH,\'' . '' . '\' AS DISPLAY FROM custom_fields cf,student_field_categories sfc WHERE sfc.ID=cf.CATEGORY_ID AND (SELECT DISTINCT CAN_USE FROM profile_exceptions WHERE PROFILE_ID=\'' . $profile_id_mod . '\' AND MODNAME=CONCAT(\'' . 'students/Student.php&category_id=' . '\',cf.CATEGORY_ID))=\'' . 'Y' . '\' ORDER BY sfc.SORT_ORDER,sfc.TITLE,cf.SORT_ORDER,cf.TITLE'), array('SEARCH' => '_make', 'DISPLAY' => '_make'), array('CATEGORY')); } } $THIS_RET['ID'] = 'CONTACT_INFO'; $custom_fields_RET[-1][1] = array('CATEGORY' => '<B>Contact Information</B>', 'ID' => 'CONTACT_INFO', 'TITLE' => '<IMG SRC=assets/down_phone_button.gif width=15> Contact Info Rollover', 'DISPLAY' => _make('', 'DISPLAY')); $THIS_RET['ID'] = 'HOME_PHONE'; $custom_fields_RET[-1][] = array('CATEGORY' => '<B>Contact Information</B>', 'ID' => 'HOME_PHONE', 'TITLE' => 'Home Phone Number', 'DISPLAY' => _make('', 'DISPLAY')); $THIS_RET['ID'] = 'GUARDIANS'; $custom_fields_RET[-1][] = array('CATEGORY' => '<B>Contact Information</B>', 'ID' => 'GUARDIANS', 'TITLE' => 'Guardians', 'DISPLAY' => _make('', 'DISPLAY')); $THIS_RET['ID'] = 'ALL_CONTACTS'; $custom_fields_RET[-1][] = array('CATEGORY' => '<B>Contact Information</B>', 'ID' => 'ALL_CONTACTS', 'TITLE' => 'All Contacts', 'DISPLAY' => _make('', 'DISPLAY')); $custom_fields_RET[0][1] = array('CATEGORY' => '<B>Addresses</B>', 'ID' => 'ADDRESS', 'TITLE' => 'None', 'DISPLAY' => _makeAddress('')); $custom_fields_RET[0][] = array('CATEGORY' => '<B>Addresses</B>', 'ID' => 'ADDRESS', 'TITLE' => '<IMG SRC=assets/house_button.gif> Residence', 'DISPLAY' => _makeAddress('RESIDENCE')); $custom_fields_RET[0][] = array('CATEGORY' => '<B>Addresses</B>', 'ID' => 'ADDRESS', 'TITLE' => '<IMG SRC=assets/mailbox_button.gif> Mailing', 'DISPLAY' => _makeAddress('MAILING')); $custom_fields_RET[0][] = array('CATEGORY' => '<B>Addresses</B>', 'ID' => 'ADDRESS', 'TITLE' => '<IMG SRC=assets/bus_button.gif> Bus Pickup', 'DISPLAY' => _makeAddress('BUS_PICKUP')); $custom_fields_RET[0][] = array('CATEGORY' => '<B>Addresses</B>', 'ID' => 'ADDRESS', 'TITLE' => '<IMG SRC=assets/bus_button.gif> Bus Dropoff', 'DISPLAY' => _makeAddress('BUS_DROPOFF')); if (User('PROFILE') == 'admin' || User('PROFILE') == 'teacher') { $columns = array('CATEGORY' => '', 'TITLE' => 'Field', 'SEARCH' => 'Search', 'DISPLAY' => 'Expanded View'); } else { $columns = array('CATEGORY' => '', 'TITLE' => 'Field', 'DISPLAY' => 'Expanded View'); } ListOutputMod($custom_fields_RET, $columns, '', '', array(), array(array('CATEGORY'))); } PopTable('footer'); if ($_REQUEST['tab'] == 'display_options') { echo "<CENTER><INPUT type=submit class=\"btn_medium\" value=Save ></CENTER>";
echo '<INPUT type=hidden name=values[StaffFieldsSearch]><INPUT type=hidden name=values[StaffFieldsView]>'; $columns = array('CATEGORY' => '', 'TITLE' => _('Field'), 'STAFF_SEARCH' => _('Search'), 'STAFF_DISPLAY' => _('Expanded View')); ListOutput($custom_fields_RET, $columns, _('User Field'), _('User Fields'), array(), array(array('CATEGORY'))); } if ($_REQUEST['tab'] == 'staff_widgets' && User('PROFILE') == 'admin') { $widgets = array(); if ($CentreModules['Users']) { $widgets += array('permissions' => _('Permissions')); } if ($CentreModules['Food_Service']) { $widgets += array('fsa_balance' => _('Food Service Balance'), 'fsa_status' => _('Food Service Status'), 'fsa_barcode' => _('Food Service Barcode')); } $widgets_RET[0] = array(); foreach ($widgets as $widget => $title) { $THIS_RET['ID'] = $widget; $widgets_RET[] = array('ID' => $widget, 'TITLE' => $title, 'STAFF_WIDGET' => _make('', 'STAFF_WIDGET')); } unset($widgets_RET[0]); echo '<INPUT type=hidden name=values[StaffWidgetsSearch]>'; $columns = array('TITLE' => _('Widget'), 'STAFF_WIDGET' => _('Search')); ListOutput($widgets_RET, $columns, '.', '.'); } echo '</fieldset>'; PopTable('footer'); echo '<CENTER><INPUT type=submit value="' . _('Save') . '"></CENTER>'; echo '</FORM>'; } function _make($value, $name) { global $THIS_RET, $current_RET; switch ($name) {
/** * Returns the correct resource as specified by the manifest files * * @param Zend_Config $config * @return Object */ public static function makeResource(Zend_Config $config) { return _make(self::MF_RESOURCE_TYPE); }
/** */ public function test_load_object_by_classname() { _didef('testcontainer', 'Metrodi_Tests_Container'); $obj = _make('testcontainer'); $this->assertEquals('Metrodi_Tests_Container', get_class($obj)); }