/**
* Implementation of hook_help().
*/ function addclips_help($section){ switch($section){ case'admin/settings/addclips' : returnt('The AddClips module is a module to add a button to social bookmark to using service of AddClips.<br />See <a href="@url">AddClips</a> website for details.', array('@url' => 'http://www.addclips.org/')); break; } }
/**
* Menu callback; Return AddClips settings form.
*/ function addclips_settings(){ $form['addclips_use'] = array( '#type' => 'checkbox', '#title' => t('Use AddClips'), '#description' => t('If checked this add a social bookmark button of AddClips.'), '#default_value' => variable_get('addclips_use', 0), ); $form['addclips_id'] = array( '#type' => 'textfield', '#title' => t('AddClips ID'), '#description' => t('Input the AddClips ID. It is the part of "addclipsId =" in the created cord of AddClips website.'), '#default_value' => variable_get('addclips_id', ''), '#size' => 20, ); $form['addclips_object'] = array( '#type' => 'select', '#title' => t('Bookmark object'), '#description' => t('Choose the object of the bookmarks.'), '#options' => array( 'site' => t('The index page of this site'), 'page' => t('Each contents in this site'), ), '#default_value' => variable_get('addclips_object', 'page'), ); $form['addclips_view'] = array( '#type' => 'select', '#title' => t('AddClips View'), '#description' => t('Choose the view point of the AddClips.'), '#options' => array( 'both' => t('Both (Teaser and full node)'), 'node' => t('Full node'), 'teaser' => t('Teaser'), ), '#default_value' => variable_get('addclips_view', 'both'), ); $node_types = node_get_types('names'); $node_types['---'] = t('- Not excluded -'); $form['addclips_nodetypes_exclude'] = array( '#type' => 'select', '#multiple' => true, '#title' => t('Excluded node types'), '#description' => t('Select the node types to exclude from use AddClips button.'), '#default_value' => variable_get('addclips_nodetypes_exclude', array()), '#options' => $node_types, ); $form['addclips_type'] = array( '#type' => 'select', '#title' => t('Button type'), '#description' => t('Choose the button type.'), '#options' => array( 1 => t('"Bookmark" character string and 5 icons'), 0 => t('9 icons'), 2 => t('"Bookmark" character string and 2 icons'), 5 => t('5 icons'), 3 => t('"Bookmark" short character string and 2 icons'), 4 => t('Icon'), ), '#default_value' => variable_get('addclips_type', 5), ); $form['addclips_valign'] = array( '#type' => 'select', '#title' => t('Vertical align of the button'), '#description' => t('Choose the vertical align of the button.'), '#options' => array( 'middle' => t('Align middle'), 'top' => t('Align top'), 'bottom' => t('Align bottom'), ), '#default_value' => variable_get('addclips_valign', 'middle'), ); $form['addclips_colors'] = array( '#type' => 'fieldset', '#title' => t('Color settings of the overlay window'), '#description' => t('Choose the color set. When you chose custom setting, set a color below.'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#prefix' => '<div class="addclips-colors">', '#suffix' => '</div>', ); $form['addclips_colors']['addclips_colorset'] = array( '#type' => 'select', '#title' => t('Color Set'), '#options' => array( '#78BE44,#D1E9C0,#666666' => t('Green (Default)'), '#FF4646,#FFACAC,#FFFFFF' => t('Red'), '#0080FF,#7AB1F5,#FFFFFF' => t('Blue'), '#FF6600,#FF9900,#FFFFFF' => t('Orange'), '#999999,#F6F6F6,#666666' => t('Gray'), '#000000,#333333,#ffffff' => t('Black'), 'custom' => t('Custom'), ), '#default_value' => variable_get('addclips_colorset', '#2385c2,#5ab5ee,#494949'), ); if(module_exists('colorpicker')){ $form['addclips_colors']['addclips_colorpicker'] = array( '#type' => 'colorpicker', '#title' => t('Color picker'), '#prefix' => '<div class="colorsettings-colorpicker">', '#suffix' => '</div>', ); $form['addclips_colors']['addclips_b_pickcolor'] = array( '#type' => 'colorpicker_textfield', '#title' => t('Border color'), '#default_value' => variable_get('addclips_b_pickcolor', '#'), '#colorpicker' => 'addclips_colorpicker', '#maxlength' => 7, ); $form['addclips_colors']['addclips_n_pickcolor'] = array( '#type' => 'colorpicker_textfield', '#title' => t('Background color'), '#default_value' => variable_get('addclips_n_pickcolor', '#'), '#colorpicker' => 'addclips_colorpicker', '#maxlength' => 7, ); $form['addclips_colors']['addclips_t_pickcolor'] = array( '#type' => 'colorpicker_textfield', '#title' => t('Text color'), '#default_value' => variable_get('addclips_t_pickcolor', '#'), '#colorpicker' => 'addclips_colorpicker', '#maxlength' => 7, ); } else{ $form['addclips_colors']['addclips_b_color'] = array( '#type' => 'textfield', '#title' => t('Border color'), '#default_value' => variable_get('addclips_b_color', ''), '#maxlength' => 7, '#size' => 15, ); $form['addclips_colors']['addclips_n_color'] = array( '#type' => 'textfield', '#title' => t('Background color'), '#default_value' => variable_get('addclips_n_color', ''), '#maxlength' => 7, '#size' => 15, ); $form['addclips_colors']['addclips_t_color'] = array( '#type' => 'textfield', '#title' => t('Text color'), '#default_value' => variable_get('addclips_t_color', ''), '#maxlength' => 7, '#size' => 15, ); } returnsystem_settings_form($form); }