plugin_meta = get_plugin_meta_wpcomment(); } /* * returning relevant input object */ public function get_input( $type ) { // global $plugin_meta; $class_name = 'NM_' . ucfirst( $type ); $file_name = 'input.' . $type . '.php'; if ( ! class_exists( $class_name ) ) { require_once wpcf_get_path() . '/classes/inputs/' . $file_name; } return new $class_name(); } /* * loading scripts needed by input control */ function load_input_scripts() { if ( $this->input_scripts['shipped'] ) { foreach ( $this->input_scripts['shipped'] as $handler ) { wp_enqueue_script( $handler ); } } // front end scripts if ( isset( $this->input_scripts['custom'] ) && $this->input_scripts['custom'] ) { foreach ( $this->input_scripts['custom'] as $scripts => $script ) { // checking if it is style if ( $script['type'] == 'js' ) { wp_enqueue_script( $this->plugin_meta['shortname'] . '-' . $script['script_name'], $this->plugin_meta['url'] . $script['script_source'], $script['depends'], '3.0', $script['in_footer'] ); } else { wp_enqueue_style( $this->plugin_meta['shortname'] . '-' . $script['script_name'], $this->plugin_meta['url'] . $script['script_source'] ); } } } } /* * check if browser is ie */ function if_browser_is_ie() { // print_r($_SERVER['HTTP_USER_AGENT']); if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Chrome' ) == false ) || strpos( $_SERVER['HTTP_USER_AGENT'], 'Safari' ) == false ) { return true; } else { return false; } } /* * get current page url with query string */ function current_page_url() { $page_url = 'http'; if ( isset( $_SERVER['HTTPS'] ) ) { if ( $_SERVER['HTTPS'] == 'on' ) { $page_url .= 's';} } $page_url .= '://'; if ( $_SERVER['SERVER_PORT'] != '80' ) { $page_url .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI']; } else { $page_url .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; } return $page_url; } }