arrays - drupal admin.inc, loop list_modules as form settings -


i need loop values of

$blocks = array();  $blocks['list_modules'] 

with this:

$form['advanced']['custom_acc'] = array(     '#type' => 'select',     '#title' => t('module title'),     '#options' => array(       0 => t('no control'),       1 => t('controlled'),       ),   ); 

so should become something like this

        while (list(, $value) = each($blocks)) {         echo "      $form['advanced']['custom_->blocks array value'] = array(         '#type' => 'select',         '#title' => t('->blocks array value'),         '#options' => array(           0 => t('no control'),           1 => t('controlled'),           ),       );   "; } 

but of course not working, got ideas? guess have use foreach, hope can see im trying achieve,

thanks in advance!

fixed myself :)

    $blocks = array(); $blocks = module_list();  foreach ($blocks $key => $title) {  $form['advanced'][$title] = array(     '#type' => 'select',     '#title' => t($title),     '#options' => array(       0 => t('no control'),       1 => t('controlled'),       ),   ); } 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -