function daynight_add_timecondition($daynight_ref) { global $db; // We don't know what the new timecondition id is yet so we will put a place holder and check it when the page reloads // daynight_edit_timecondition('add', $daynight_ref); }
function daynight_hookProcess_timeconditions($viewing_itemid, $request) { $daynight_ref = isset($request['daynight_ref']) ? $request['daynight_ref'] : ''; // Do the un-natural act of checking to see if the last call was an add // in which case we left a place holder for the timeconditions_id and we // need to go up-date it // // This is necessary because this process hook is called prior to the // creation of the timecondition from the timeconditions module // if (!isset($request['action'])) { daynight_checkadd_timecondition($daynight_ref); } else { switch ($request['action']) { case 'add': // we don't have an viewing_itemid at this point daynight_add_timecondition($daynight_ref); break; case 'delete': daynight_del_timecondition($viewing_itemid); break; case 'edit': daynight_edit_timecondition($viewing_itemid, $daynight_ref); break; } } }