/**
  * Return HTML and messages for gallery editor
  */
 public static function getEditorDialog()
 {
     global $wgExtensionMessagesFiles, $wgTitle, $wgRequest;
     wfProfileIn(__METHOD__);
     // show upload form?
     $showUploadForm = WikiaPhotoGalleryHelper::isUploadAllowed();
     // list of recently uploaded images
     $recentlyUploaded = WikiaPhotoGalleryHelper::getRecentlyUploadedThumbs();
     // list of images on current article
     $imagesOnPage = WikiaPhotoGalleryHelper::getImagesFromPageThumbs($wgTitle);
     // render dialog
     $template = new EasyTemplate(dirname(__FILE__) . '/templates');
     $template->set_vars(array('alignments' => array('left', 'center', 'right'), 'imagesOnPage' => WikiaPhotoGalleryHelper::renderImagesList('images', $imagesOnPage), 'recentlyUploaded' => WikiaPhotoGalleryHelper::renderImagesList('uploaded', $recentlyUploaded), 'showUploadForm' => $showUploadForm));
     $html = $template->render('editorDialog');
     // get list of this extension messages
     $messages = array();
     require $wgExtensionMessagesFiles['WikiaPhotoGallery'];
     // contains i18n in $messages
     $list = array_keys($messages['en']);
     // additional messages
     $list[] = 'save';
     $list[] = 'ok';
     $list[] = 'cancel';
     // toolbar buttons tooltips
     $list[] = 'bold_tip';
     $list[] = 'italic_tip';
     $list[] = 'link_tip';
     $msg = array();
     foreach ($list as $key) {
         $msg[$key] = wfMsg($key);
     }
     // get list of gallery parameters default values
     $ig = new WikiaPhotoGallery();
     $defaultParamValues = $ig->getDefaultParamValues();
     $res = array('html' => $html, 'msg' => $msg, 'defaultParamValues' => $defaultParamValues);
     wfProfileOut(__METHOD__);
     return $res;
 }