'fieldset', '#title' => t('Pages'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#attached' => array( 'js' => array(drupal_get_path('module', 'menu_position') . '/plugins/menu_position.pages.js'), ), ); $form['conditions']['pages']['pages'] = array( '#type' => 'textarea', '#title' => t('Pages'), '#default_value' => !empty($variables['pages']) ? $variables['pages'] : '', '#description' => t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '')), '#weight' => -20, ); // Add a submit handler. $form['#submit'][] = 'menu_position_menu_position_rule_pages_form_submit'; } /** * Prepares the "node type" variables to be stored in the rule. * * @param $form * A reference to the "add/edit rule" form array. * @param $form_state * A reference to the current form state, including submitted values. */ function menu_position_menu_position_rule_pages_form_submit(&$form, &$form_state) { // The user has added our plugin's form elements as a condition for the rule. if (!empty($form_state['values']['pages'])) { // Add this plugin's variables to the rule. $variables = array( 'pages' => drupal_strtolower(trim($form_state['values']['pages'])), ); $form_state['values']['conditions']['pages'] = $variables; } }