示例#1
0
 /**
  * Main function of the plugin.
  *
  * @param string $content Content.
  * @param array $conf The configuration array.
  * @return string The rendered content.
  * @author Romain Ruetschi <*****@*****.**>
  */
 public function main($content, array $conf)
 {
     // Initialize the plugin.
     $this->_initialize($content, $conf);
     $this->extPath = t3lib_extMgm::extRelPath($this->extKey);
     $this->extPath = str_replace('../', '/', $this->extPath);
     $this->_client = t3lib_div::makeInstance('Tx_Picasa_Client', $this->_conf['user'], $this->_conf['pass']);
     $this->_templatesPath = t3lib_extMgm::extPath($this->extKey) . 'res/templates/pi2/';
     $this->_view = t3lib_div::makeInstance('Tx_Fluid_View_StandaloneView');
     $this->_view->assign('conf', $this->_conf);
     switch (TRUE) {
         case !empty($_POST):
             $this->handleUpload($this->piVars['album']);
             break;
         case !empty($this->piVars['album']):
             $this->showUploadFormAction($this->piVars['album']);
             break;
         default:
             $this->showAlbumsListAction();
     }
     $content = $this->_view->render();
     return $this->_baseWrap($content);
 }
 /**
  * @test
  * @expectedException Tx_Fluid_View_Exception_InvalidTemplateResourceException
  * @author Bastian Waidelich <*****@*****.**>
  */
 public function renderThrowsExceptionIfSpecifiedTemplateFileDoesNotExist()
 {
     $this->view->setTemplatePathAndFilename('NonExistingTemplatePath');
     $this->view->render();
 }