public static function set_profile(stdClass $profile, $profile_password = null) { hd_print("API: method 'set_profile'"); $query = array(ZTVApi::set_terminal_params($profile), ZTVApi::get_terminal_params()); if ($profile->require_password && !is_null($profile_password)) { $query[] = ZTVApi::update_profile($profile, $profile_password); } return $query; }
public function load_profiles() { if (ZTVTerminal::login()) { $json_reply = ZTVApi::call(array(ZTVApi::get_terminal_params(), ZTVApi::get_profiles())); if ($json_reply) { $profile_id = $json_reply[0]->result->profile_id; $profiles = $json_reply[1]->result; foreach ($profiles as $profile) { $this->profiles[$profile->id] = $profile; } $this->profile = $this->profiles[$profile_id ? $profile_id : 1]; return true; } } return false; }