private function getForm()
 {
     $request = $this->getRequest();
     $language_id = $request->getQuery('id');
     $model_language = new Model_Language();
     if ($language_id) {
         $language_info = $model_language->getLanguage($language_id);
     }
     $countrycode = Model_Countries::getCountriesPairs();
     $this->view->locale_territories = array();
     $locale_territories = JO_Locale::listTerritory();
     if ($locale_territories) {
         $sort_order = array();
         foreach ($locale_territories as $iso2 => $lt) {
             if (isset($countrycode[$iso2])) {
                 $sort_order[$lt] = $countrycode[$iso2];
                 $this->view->locale_territories[$lt] = array('code' => $lt, 'name' => $countrycode[$iso2]);
             } else {
                 $sort_order[$lt] = $iso2;
                 $this->view->locale_territories[$lt] = array('code' => $lt, 'name' => $iso2);
             }
         }
         array_multisort($sort_order, SORT_ASC, $this->view->locale_territories);
     }
     $this->view->flags = $this->getFlags();
     if ($request->getPost('name')) {
         $this->view->name = $request->getPost('name');
     } elseif (isset($language_info)) {
         $this->view->name = $language_info['name'];
     }
     if ($request->getPost('code')) {
         $this->view->code = $request->getPost('code');
     } elseif (isset($language_info)) {
         $this->view->code = $language_info['code'];
     }
     if ($request->getPost('locale')) {
         $this->view->locale = $request->getPost('locale');
     } elseif (isset($language_info)) {
         $this->view->locale = $language_info['locale'];
     }
     if ($request->getPost('locale_territory')) {
         $this->view->locale_territory = $request->getPost('locale_territory');
     } elseif (isset($language_info)) {
         $this->view->locale_territory = $language_info['locale_territory'];
     }
     if ($request->getPost('image')) {
         $this->view->image = $request->getPost('image');
     } elseif (isset($language_info)) {
         $this->view->image = $language_info['image'];
     }
     if ($request->getPost('status')) {
         $this->view->status = $request->getPost('status');
     } elseif (isset($language_info)) {
         $this->view->status = $language_info['status'];
     }
 }