Ejemplo n.º 1
0
 /**
  * Hook into upgrader_post_install
  * 
  * Do actions or modify return after upgrader has run for lens installation
  * 
  * @param mixed $res boolean(true) if the upload is deemed successful or WP_Error object if failed
  * @param array $hook_extra Extra values passed to the upload routine
  * @param array $result The results of the upload
  * 
  * @return mixed
  */
 function upgrader_post_install($res, $hook_extra, $result)
 {
     // Make sure this is a lens upload
     if (!is_wp_error($res) && isset($hook_extra['lens_dirname'])) {
         $lens_meta = $this->Lens->get_meta($result['destination'] . "lens.json");
         slidedeck2_km("SlideDeck Installed Lens", array('name' => $lens_meta['meta']['name'], 'slug' => $lens_meta['slug']));
     }
     return $res;
 }
Ejemplo n.º 2
0
 /**
  * Save a SlideDeck
  */
 function save()
 {
     if (!isset($_POST['id'])) {
         return false;
     }
     $slidedeck_id = intval($_POST['id']);
     $slidedeck = $this->SlideDeck->save($slidedeck_id, $_POST);
     $action = '&action=edit&slidedeck=' . $slidedeck_id;
     if ($_POST['action'] == "create") {
         $action .= '&firstsave=1';
         slidedeck2_km("New SlideDeck Created", array('source' => $slidedeck['source'], 'lens' => $slidedeck['lens'], 'type' => $slidedeck['type']));
     }
     wp_redirect($this->action($action));
     exit;
 }