/[drupal]/contributions/modules/css_injector/css_injector.admin.inc
ViewVC logotype

Diff of /contributions/modules/css_injector/css_injector.admin.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.5, Wed Jul 30 18:06:15 2008 UTC revision 1.1.2.6, Sun Aug 10 01:56:58 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: css_injector.admin.inc,v 1.1.2.4 2008/01/28 01:26:09 eaton Exp $  // $Id: css_injector.admin.inc,v 1.1.2.5 2008/07/30 18:06:15 add1sun Exp $
3    
4  /**  /**
5   * Page callback for CSS Injector's main admin page.   * Page callback for CSS Injector's main admin page.
# Line 9  function css_injector_admin_form() { Line 9  function css_injector_admin_form() {
9    $path = drupal_get_path('module', 'css_injector') .'/';    $path = drupal_get_path('module', 'css_injector') .'/';
10    $form = array();    $form = array();
11    $form['#tree'] = TRUE;    $form['#tree'] = TRUE;
12    foreach($rules as $rule) {    foreach ($rules as $rule) {
13      $form['rules'][$rule['crid']]['#rule'] = $rule;      $form['rules'][$rule['crid']]['#rule'] = $rule;
14      $form['rules'][$rule['crid']]['edit'] = array(      $form['rules'][$rule['crid']]['edit'] = array(
15        '#type' => 'image_button',        '#type' => 'image_button',
# Line 55  function theme_css_injector_admin_form(& Line 55  function theme_css_injector_admin_form(&
55    $headers = array(t('Title'), t('File path'), t('Actions'));    $headers = array(t('Title'), t('File path'), t('Actions'));
56    $rows = array();    $rows = array();
57    if (!empty($form['rules'])) {    if (!empty($form['rules'])) {
58      foreach(element_children($form['rules']) as $crid) {      foreach (element_children($form['rules']) as $crid) {
59        $row = array();        $row = array();
60        $rule = $form['rules'][$crid]['#rule'];        $rule = $form['rules'][$crid]['#rule'];
61        $row[] = check_plain($rule['title']);        $row[] = check_plain($rule['title']);
# Line 81  function theme_css_injector_admin_form(& Line 81  function theme_css_injector_admin_form(&
81    }    }
82    $rows[] = $row;    $rows[] = $row;
83    
   $output = '<p>'. t("Use CSS injection rules to add small snippets of CSS to the page output when specific criteria are met. For example, a simple rule could change the page background color at night or float a particular div to the right on node editing pages.") .'</p>';  
84    $output .= theme('table', $headers, $rows);    $output .= theme('table', $headers, $rows);
85    $output .= drupal_render($form);    $output .= drupal_render($form);
86    return $output;    return $output;
# Line 230  function css_injector_edit_save($form, & Line 229  function css_injector_edit_save($form, &
229    
230    
231  /**  /**
232   * Menu callback -- ask for confirmation of rule deletion   * Menu callback -- ask for confirmation of rule deletion.
233   */   */
234  function css_injector_delete_confirm(&$form_state, $crid) {  function css_injector_delete_confirm(&$form_state, $crid) {
235    $form['crid'] = array(    $form['crid'] = array(
# Line 249  function css_injector_delete_confirm(&$f Line 248  function css_injector_delete_confirm(&$f
248  }  }
249    
250  /**  /**
251   * Execute node deletion   * Execute node deletion.
252   */   */
253  function css_injector_delete_confirm_submit($form, &$form_state) {  function css_injector_delete_confirm_submit($form, &$form_state) {
254    if ($form_state['values']['confirm']) {    if ($form_state['values']['confirm']) {

Legend:
Removed from v.1.1.2.5  
changed lines
  Added in v.1.1.2.6

  ViewVC Help
Powered by ViewVC 1.1.2