Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 25th, 2012  |  syntax: None  |  size: 0.76 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. function _mapal_buldings () {
  3.  
  4.   drupal_add_css (drupal_get_path ('module', 'mapal') . '/css/mapal_base_view.css');
  5.  
  6.  
  7.  
  8.   module_load_include ('inc', 'mapal', 'includes/BaseModel.class');
  9.   module_load_include ('inc', 'mapal', 'includes/BuildingsModel.class');
  10.  
  11.   $infos = mapal\BuildingsModel::getBuildingsInfos(mapal\BaseModel::getSelectedBaseID());
  12.  
  13.   $form = array ();
  14.   $form['base_view'] = array (
  15.     '#type'       => 'theme',
  16.     '#theme'        => 'mapal_base_view',
  17.     '#buildings'        => $infos
  18.   );
  19.  
  20.   foreach ($infos as $info) {
  21.     _mapal_buildings_create_building_element ($form['shop_view'], $info);
  22.   }
  23.  
  24.   $form['buy'] = array (
  25.     '#type'       => 'submit',
  26.     '#value'    => t('Buy selected buildings')
  27.   );
  28.  
  29.   return $form;
  30. }