src/libraries/controllers/ApiPhotoController.php
/**
    * Get a form to edit a photo specified by the ID.
    *
    * @param string $id ID of the photo to be edited.
    * @return string Standard JSON envelope
    */
Get a form to edit a photo specified by the ID.
@param string $id ID of the photo to be edited.
@return string Standard JSON envelope
Get a form to edit a photo specified by the ID . @param string $id ID of the photo to be edited . @return string Standard JSON envelope
public function edit($id)
  {
    getAuthentication()->requireAuthentication();
    $photoResp = $this->api->invoke("/{$this->apiVersion}/photo/{$id}/view.json", EpiRoute::httpGet);
    $groupsResp = $this->api->invoke("/{$this->apiVersion}/groups/list.json", EpiRoute::httpGet);
    $albumsResp = $this->api->invoke("/{$this->apiVersion}/albums/list.json", EpiRoute::httpGet);
    $photo = $photoResp['result'];
    $groups = $groupsResp['result'];
    $albums = $albumsResp['result'];
    if(!$groups)
      $groups = array();
    if(!$albums)
      $albums = array();
    if($photo)
    {
      $template = sprintf('%s/photo-edit.php', $this->config->paths->templates);
      $license = null;
      if(isset($photo['license']))
        $license = $photo['license'];
      $this->template->url = new Url;
      $this->template->utility = new Utility;
      $markup = $this->template->get($template, array('photo' => $photo, 'albums' => $albums, 'groups' => $groups, 'licenses' => $this->utility->getLicenses($license), 'crumb' => getSession()->get('crumb')));
      return $this->success('Photo edit markup', array('markup' => $markup));
    }
    return $this->error('Photo edit markup failure', false);
  }
public function edit ( $ id ) { getAuthentication ( ) -> requireAuthentication ( ) ; $ photoResp = $ this -> api -> invoke ( " / { $ this -> apiVersion } /photo/ { $ id } /view.json " , EpiRoute :: httpGet ) ; $ groupsResp = $ this -> api -> invoke ( " / { $ this -> apiVersion } /groups/list.json " , EpiRoute :: httpGet ) ; $ albumsResp = $ this -> api -> invoke ( " / { $ this -> apiVersion } /albums/list.json " , EpiRoute :: httpGet ) ; $ photo = $ photoResp [ 'result' ] ; $ groups = $ groupsResp [ 'result' ] ; $ albums = $ albumsResp [ 'result' ] ; if ( ! $ groups ) $ groups = array ( ) ; if ( ! $ albums ) $ albums = array ( ) ; if ( $ photo ) { $ template = sprintf ( '%s/photo-edit.php' , $ this -> config -> paths -> templates ) ; $ license = null ; if ( isset ( $ photo [ 'license' ] ) ) $ license = $ photo [ 'license' ] ; $ this -> template -> url = new Url ; $ this -> template -> utility = new Utility ; $ markup = $ this -> template -> get ( $ template , array ( 'photo' => $ photo , 'albums' => $ albums , 'groups' => $ groups , 'licenses' => $ this -> utility -> getLicenses ( $ license ) , 'crumb' => getSession ( ) -> get ( 'crumb' ) ) ) ; return $ this -> success ( 'Photo edit markup' , array ( 'markup' => $ markup ) ) ; } return $ this -> error ( 'Photo edit markup failure' , false ) ; }
Get a form to edit a photo specified by the ID.
Get a form to edit a photo specified by the ID .