render('options'); } public function process() { if ( !empty( $_POST['metathesis_submit'] ) ): if ( class_exists( $_POST['metathesis_class'] ) ): $metathesis = new $_POST['metathesis_class']; $result = $metathesis->import(); if ( $result ): $this->render_message( 'Metasynthesis Complete.' ); endif; else: $this->render_error( $_POST['metathesis_class'] . ' class does not exist.' ); endif; endif; } static function targets() { $targets = array(); $targets = apply_filters( 'metathesis_targets', $targets ); return $targets; } protected function render($view, $args = array(), $ajax = false) { extract( $args ); if ( $ajax ): ob_start(); endif; $file = rtrim(dirname( __FILE__ ), '/') . '/view/' . $view . '.php'; if ( file_exists( $file ) ): include $file; else: echo '
' . $file . ' not found.'; endif; if ( $ajax ): $output = ob_get_contents(); ob_end_clean(); return $output; endif; } protected function render_message($message, $timeout = 0) { ?>