Exemplo n.º 1
0
 public static function makedf($row, $list_p)
 {
     global $wpdb;
     self::remove_pipes($row['id']);
     require_once dirname(__FILE__) . DS . 'plugins.php';
     $list_processors = PIPES_Helper_Plugins::getProcessors();
     $proc_array = explode('-', $list_p);
     $qry = "INSERT INTO `{$wpdb->prefix}wppipes_pipes` (`id`,`code`,`name`,`item_id`,`params`,`ordering`) VALUES \n";
     foreach ($proc_array as $key => $proc) {
         if (isset($list_processors[$proc])) {
             $name_proc = $list_processors[$proc]['name'];
             $pr_proc = '';
         }
         /*$proc_obj	= self::get_dfparams($proc);
         		$pr_proc	= $proc_obj->params;
         		$name_proc	= $proc_obj->name;*/
         if (in_array($row['adapter'], array('zoo', 'post')) && $proc == 'image') {
             $pr_proc = json_decode($pr_proc);
             $pr_proc->makelist = 1;
             $pr_proc->remove = 1;
             $pr_proc = json_encode($pr_proc);
         }
         $qry .= "\n(NULL, '{$proc}', '{$name_proc}', {$row['id']}, '" . addslashes($pr_proc) . "', {$key}),";
     }
     $qry = substr($qry, 0, -1);
     $wpdb->query($qry);
     //if(!$db->query()){
     //			echo $db->getQuery();
     //			echo '<br />Error: '.$db->getErrorMsg();
     //			exit();
     //		}elseif(isset($_GET['x'])) {
     //			echo '<br /><br />'.$qry;
     //			exit();
     //		}
     $inputs = self::get_inputs($row['adapter']);
     $outputs = self::get_outputs();
     //, outputs
     $qry = "UPDATE `{$wpdb->prefix}wppipes_items`\n" . "SET `inputs` = '{$inputs}',\n" . "`outputs` = '{$outputs}'\n" . "WHERE `id` = '{$row['id']}' LIMIT 1";
     $wpdb->query($qry);
     //if(!$db->query()){
     //			echo $db->getQuery();
     //			echo '<br />ERROR: '.$db->getErrorMsg();exit();
     //		}
 }
Exemplo n.º 2
0
 public function check_exist_plugin($key, $type)
 {
     require_once dirname(dirname(__FILE__)) . DS . 'helpers' . DS . 'plugins.php';
     $plugins = PIPES_Helper_Plugins::getPlugins(true, $type);
     if (array_key_exists($key, $plugins)) {
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 3
0
 /**
  * get Plugins listing, filter by $type: engine, adapter, processor
  * */
 function getAddons($type = '', $show_desc = false)
 {
     global $wpdb;
     require_once PIPES_PATH . DS . 'helpers' . DS . 'plugins.php';
     $addons = PIPES_Helper_Plugins::getPlugins(true, $type);
     // Get Addon Description
     $ILove = array();
     foreach ($addons as $addon) {
         $You = new stdClass();
         $You->value = $addon['element'];
         /*if ( isset( $addon['description'] ) && $show_desc ) {
         			$You->text = $addon['name'] . ' (' . $addon['description'] . ')';
         		} else {
         			$You->text = $addon['name'];
         		}*/
         $You->text = $addon['name'];
         $ILove[] = $You;
     }
     if (isset($_GET['x'])) {
         echo "\n\n<br /><i><b>File:</b>" . __FILE__ . ' <b>Line:</b>' . __LINE__ . "</i><br />\n\n";
         echo '<pre>';
         print_r($ILove);
         echo '</pre>';
     }
     //		$ILove = $addons;
     return $ILove;
 }
Exemplo n.º 4
0
 public function getPlugins()
 {
     require_once dirname(dirname(__FILE__)) . DS . 'helpers' . DS . 'plugins.php';
     return PIPES_Helper_Plugins::getPlugins(true);
 }