示例#1
0
 /**
  * Displays a table of the current modules content.
  *
  * Route: admin/multilanguage/modules/manage/:slug
  *
  * @param string $module The name of the module to get content for.
  */
 public static function manageModule($module)
 {
     $output = array();
     $content = Multilanguage::getModuleContent($module);
     if ($content) {
         foreach ($content as $type => $typeContent) {
             $table = Html::table();
             $header = $table->addHeader();
             $header->addCol('Content');
             if ($typeContent) {
                 foreach ($typeContent as $id => $data) {
                     $data = String::truncate($data, 200, '...');
                     $row = $table->addRow();
                     $row->addCol(Html::a()->get($data, 'admin/multilanguage/modules/manage/' . $module . '/' . $type . '/' . $id));
                 }
             } else {
                 $table->addRow()->addCol('<em>No content.</em>');
             }
             $output[] = array('title' => ucfirst($type) . ' Content', 'content' => $table->render());
         }
     } else {
         $output = array('title' => 'No Content', 'content' => '<p>This module has not specified any content to manage.</p>');
     }
     return $output;
 }