'error', 'msg' => 'Podczas zapisywania klienta wystąpił błąd. Proszę spróbować ponownie.' ]; $values = \S::json_to_array( \S::get( 'values' ) ); $id = \factory\BackendSites::topic_save( (int)$values[ 'id' ], $values[ 'strona' ], $values[ 'kategoria' ], $values[ 'kategoria_id' ], $values['link'], $values[ 'temat' ], $values['wygeneruj_temat'], $values[ 'data_publikacji' ], $values[ 'opublikowany' ], $values[ 'zaakceptowany' ] ); if ( $id ) $response = [ 'status' => 'ok', 'msg' => 'Projekt został zapisany.', 'id' => $id ]; echo json_encode( $response ); exit; } static public function topic_edit() { return \Tpl::view( 'backend_sites/topic_edit', [ 'topic' => \factory\BackendSites::topic( (int)\S::get( 'id' ) ) ] ); } static public function topics() { return \Tpl::view( 'backend_sites/topics' ); } static public function collective_topics() { return \Tpl::view( 'backend_sites/collective_topics' ); } static public function collective_topic_edit() { return \Tpl::view( 'backend_sites/collective_topic_edit',[ 'collective_topic' => \factory\BackendSites::collective_topic( \S::get( 'id' ) ), ] ); } static public function collective_topic_save() { $response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania klienta wystąpił błąd. Proszę spróbować ponownie.' ]; $values = \S::json_to_array( \S::get( 'values' ) ); $id = \factory\BackendSites::collective_topic_save( (int)$values[ 'id' ], $values[ 'strona' ], $values[ 'kategoria' ], $values[ 'kategoria_id' ], $values[ 'temat_ogolny' ], $values[ 'data_przetworzenia' ], $values[ 'przetworzony' ] ); if ( $id ) $response = [ 'status' => 'ok', 'msg' => 'Projekt został zapisany.', 'id' => $id ]; echo json_encode( $response ); exit; } }