public function save() { $model = $this->getModel('settings'); $res = $model->save(); $msg = $res->msg; PIPES::add_message($msg); $this->display(); }
public function __construct($prefix = '', $page_prefix) { self::$__page_prefix = $page_prefix; self::$__prefix = $prefix; register_activation_hook(__FILE__, array($this, 'install')); register_deactivation_hook(__FILE__, array($this, 'uninstall')); add_action('init', array($this, 'init')); add_action('admin_init', array($this, 'pipes_plugin_redirect')); parent::__construct($prefix, $page_prefix); }
public function uninstall() { $mod = $this->getModel('plugins'); $addon = isset($_GET['addon']) ? $_GET['addon'] : ''; $res = $mod->uninstall($addon); PIPES::add_message($res); $url = remove_query_arg(array('element', 'addon', 'action', 'action2'), $_SERVER['HTTP_REFERER']); header('Location: ' . $url); exit; }
public function __construct($prefix = '', $page_prefix) { self::$__page_prefix = $page_prefix; self::$__prefix = $prefix; register_activation_hook(__FILE__, array($this, 'install')); register_deactivation_hook(__FILE__, array($this, 'uninstall')); add_action('init', array($this, 'init')); add_action('admin_init', array($this, 'pipes_plugin_redirect')); //add_action( 'upgrader_process_complete', array( $this, 'update_pipe_option' ), 20 ); parent::__construct($prefix, $page_prefix); }
</a> </div> </div> </div> </div> <div class="foobla"> <?php // Show arrow instruction for [Test this Pipe] button if (isset($_SESSION['PIPES']['messages']) && count($_SESSION['PIPES']['messages'])) { echo '<img src="' . plugin_dir_url(PIPES_MAIN_FILE_PATH) . '/assets/images/test-pipe.png" width="300" height="83" style="position:absolute;right:50px;top:45px;" />'; } ?> <?php echo PIPES::show_message(); ?> <div id="container-collapse" class="container-collapse"></div> <div class="row" style="padding-bottom: 20px;"> <!-- Pipe Title & Publish Status --> <div class="col-md-6"> <a href="#" style="display:none;"><?php echo __('none'); ?> </a> <div class="input-group input-group-lg col-xs-12"> <span class="input-group-addon"><?php echo sprintf(__('Pipe#%s'), $item->id);
wp_enqueue_style('pipes-bootstrap-extended'); wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css'); wp_enqueue_script('jquery-ui-datepicker'); wp_enqueue_script('pipes-bootstrap-min'); require_once OBGRAB_HELPERS . 'requirements.php'; $requirements = new AppRequirements(); $requirements->checkRequirements(); ?> <h2><?php echo __('WP Pipes plugin Settings'); ?> </h2> <?php echo PIPES::show_message(false); ?> <div id="col-container"> <div class="welcome-panel"> <form method="post" action=""> <table class="form-table"> <?php foreach ($this->configs->items as $setting) { echo '<tr valign="top"'; // Start at settings seems to be not necessary if ($setting->option_name == 'pipes_start_at') { echo ' class="hidden"'; } echo '>'; switch ($setting->option_name) { case 'pipes_cronjob_active':
function save() { /*echo "\n\n<br /><i><b>File:</b>".__FILE__.' <b>Line:</b>'.__LINE__."</i><br />\n\n"; echo '<pre>'; print_r($_POST); echo '</pre>';exit();*/ global $mainframe, $option; $mod = $this->getModel('pipe'); $res = $mod->save(); $msg = $res->msg; PIPES::add_message($msg); $task = filter_input(INPUT_POST, 'task'); //$apply = $task=='apply'?'&task=edit&id[]='.$res->id:''; $url = admin_url() . 'admin.php?page=' . PIPES::$__page_prefix . '.pipe&id=' . $res->id; header('Location: ' . $url); exit; // $mainframe->enqueueMessage($msg, $res->typemsg); // $mainframe->redirect("index.php?option={$option}&controller=items".$apply); }
public function import_from_file() { $upload_dir = wp_upload_dir(); $mod = $this->getModel('pipes'); $id = isset($_GET['id']) ? $_GET['id'] : 0; $file_name = isset($_GET['file_name']) ? $_GET['file_name'] : ''; if (isset($_FILES["file_import"]["name"])) { $filename = $_FILES["file_import"]["tmp_name"]; } elseif (isset($_GET['url'])) { $filename = $_GET['url']; } elseif (is_file($upload_dir['basedir'] . DS . 'wppipes' . DS . 'templates' . DS . $file_name)) { $filename = $upload_dir['basedir'] . DS . 'wppipes' . DS . 'templates' . DS . $file_name; } $file_content = file_get_contents($filename); $items = explode("\n", $file_content); $new_pipes = array(); if ($file_content == '') { $new_pipes[] = "The file has not content!"; } foreach ($items as $value) { if ($value != '') { if (substr($value, 0, 1) == '{') { $item = json_decode($value); } else { $item = json_decode(substr($value, 3)); } if (!is_object($item)) { $new_pipes[] = "There is something wrong with the structure of file's content!"; continue; } $item->current_id = $id; $new_pipes[] = $mod->import_from_file($item); } } $message = implode("</br>", $new_pipes); PIPES::add_message($message); if (isset($_GET['url'])) { $url = remove_query_arg(array('task', 'url'), $_SERVER['HTTP_REFERER']); header('Location: ' . $url); exit; } elseif ($id > 0) { $url = admin_url() . 'admin.php?page=' . PIPES::$__page_prefix . '.pipe&id=' . $id; header('Location: ' . $url); exit; } }