diff --git a/ci-bootstrap.php b/ci-bootstrap.php index 9266d9a..4ee6241 100644 --- a/ci-bootstrap.php +++ b/ci-bootstrap.php @@ -1,9 +1,9 @@ diff($date); + return $interval->y; + } diff --git a/classes/class-ci-model.php b/classes/class-ci-model.php index eb044b7..235ba17 100644 --- a/classes/class-ci-model.php +++ b/classes/class-ci-model.php @@ -8,7 +8,7 @@ class CI_Model { public function __construct(){ $this->db =& opensid_ci_load_database(); $this->load = new OPENSID___FAKE_LOAD; - include_once OPENSID_APPPATH . '/donjo-sys/core/Input.php'; + include_once OPENSID_APPPATH . '/system/core/Input.php'; $this->input = new CI_Input; } diff --git a/classes/class-opensid.php b/classes/class-opensid.php index 89b2928..6aeaef7 100644 --- a/classes/class-opensid.php +++ b/classes/class-opensid.php @@ -32,7 +32,7 @@ public static function load_ci_model( $ci_model, array $data = array() ) { $suffix = (strtolower($ci_model) == 'first') ? '_M' : '_Model'; $ci_model = ( !empty($data['__model_class_name__']) ) ? $data['__model_class_name__'] : $ci_model . $suffix; - $lwrci_model = strtolower( $ci_model ); + $lwrci_model = ucfirst(strtolower( $ci_model )); $file = ( !empty($data['__model_class_file__']) ) ? $data['__model_class_file__'] : OPENSID_APPPATH . '/donjo-app/models/' . $lwrci_model . '.php'; require_once $file; $the_class = new $ci_model(); diff --git a/controllers/controller-frontend.php b/controllers/controller-frontend.php index 1c30921..32ced60 100644 --- a/controllers/controller-frontend.php +++ b/controllers/controller-frontend.php @@ -28,38 +28,40 @@ function opensid_handle_redirects() { } } } - private static function opensid_shortcode($this, $shortcode, $function = '', $remove_old = false) { + private function opensid_shortcode($shortcode, $function = '', $remove_old = false) { if ( empty( $function ) ) $function = $shortcode; $shortcode = 'wpsid_' . $shortcode; if ( $remove_old ) remove_shortcode( $shortcode ); - add_shortcode( $shortcode, array($this, $function) ); + add_shortcode( $shortcode, array($this,$function) ); } public function init_shortcodes() { - self::opensid_shortcode( $this, 'version' ); - self::opensid_shortcode( $this, 'data_wilayah' ); - self::opensid_shortcode( $this, 'data_pendidikan' ); - self::opensid_shortcode( $this, 'data_pekerjaan' ); - self::opensid_shortcode( $this, 'data_perkawinan' ); - self::opensid_shortcode( $this, 'data_agama' ); - self::opensid_shortcode( $this, 'data_jenis_kelamin' ); - self::opensid_shortcode( $this, 'data_warga_negara' ); - self::opensid_shortcode( $this, 'data_status_penduduk' ); - self::opensid_shortcode( $this, 'data_golongan_darah' ); - self::opensid_shortcode( $this, 'data_cacat' ); - self::opensid_shortcode( $this, 'data_menahun' ); - self::opensid_shortcode( $this, 'data_umur' ); - self::opensid_shortcode( $this, 'data_pendidikan_sedang_ditempuh' ); - self::opensid_shortcode( $this, 'data_cara_kb' ); - self::opensid_shortcode( $this, 'data_akta_kelahiran' ); - self::opensid_shortcode( $this, 'layanan_mandiri_widget' ); - self::opensid_shortcode( $this, 'layanan_mandiri_detail' ); + $this->opensid_shortcode('version'); + $this->opensid_shortcode( 'data_wilayah' ); + $this->opensid_shortcode( 'data_pendidikan' ); + $this->opensid_shortcode( 'data_pekerjaan' ); + $this->opensid_shortcode( 'data_perkawinan' ); + $this->opensid_shortcode( 'data_agama' ); + $this->opensid_shortcode( 'data_jenis_kelamin' ); + $this->opensid_shortcode( 'data_warga_negara' ); + $this->opensid_shortcode( 'data_status_penduduk' ); + $this->opensid_shortcode( 'data_golongan_darah' ); + $this->opensid_shortcode( 'data_cacat' ); + $this->opensid_shortcode( 'data_menahun' ); + $this->opensid_shortcode( 'data_umur' ); + $this->opensid_shortcode( 'data_pendidikan_sedang_ditempuh' ); + $this->opensid_shortcode( 'data_cara_kb' ); + $this->opensid_shortcode( 'data_akta_kelahiran' ); + $this->opensid_shortcode( 'layanan_mandiri_widget' ); + $this->opensid_shortcode( 'layanan_mandiri_detail' ); + } public function version($atts, $content = null) { $shortcode_atts = shortcode_atts( array( 'type' => 'plain', //default: plain ), $atts ); + return OpenSID::load_shortcode( 'version', $shortcode_atts ); } public function data_wilayah() { return OpenSID::load_shortcode( 'data_wilayah' ); } diff --git a/init.php b/init.php index a08f2cb..a8ece85 100644 --- a/init.php +++ b/init.php @@ -1,4 +1,5 @@ siteman(); + OpenSID::load_ci_model('First')->siteman(); if( isset($_REQUEST['mandiri']) && $_REQUEST['mandiri'] == 'logoff' ) - OpenSID::load_ci_model('first')->logout(); + OpenSID::load_ci_model('First')->logout(); if( !self::_is_logged() ) { echo do_shortcode('[wpsid_layanan_mandiri_widget]'); } else {