? .embed_widgets_ui.module.swp
Index: embed_widgets_ui.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/embed_widgets/embed_widgets_ui/Attic/embed_widgets_ui.module,v
retrieving revision 1.4.2.129
diff -u -u -r1.4.2.129 embed_widgets_ui.module
--- embed_widgets_ui.module	15 Aug 2008 21:58:56 -0000	1.4.2.129
+++ embed_widgets_ui.module	7 Feb 2009 05:21:05 -0000
@@ -319,7 +319,7 @@
  * Preprocess function for page.tpl.php
  */
 function embed_widgets_ui_preprocess_page(&$variables) {
-  if (!$_REQUEST['embed_widgets_mode'] && variable_get('embed_widgets_button', TRUE) && user_access('create widgets')) {
+  if (empty($_REQUEST['embed_widgets_mode']) && variable_get('embed_widgets_button', TRUE) && user_access('create widgets')) {
     $source = embed_widgets_page_load($_GET['q']);
     if ($source) {
       $image = theme('image', drupal_get_path('module', 'embed_widgets') . '/embed_button.gif', t("Embed this page's content on your site."), t("Embed this page's content on your site."));
@@ -335,7 +335,7 @@
  * Preprocess function for block.tpl.php
  */
 function embed_widgets_ui_preprocess_block(&$variables) {
-  if (!$_REQUEST['embed_widgets_mode'] && variable_get('embed_widgets_button', TRUE) && user_access('create widgets')) {
+  if (empty($_REQUEST['embed_widgets_mode']) && variable_get('embed_widgets_button', TRUE) && user_access('create widgets')) {
     $source = embed_widgets_block_load($variables['block']->module, $variables['block']->delta);
     if ($source) {
       $image = theme('image', drupal_get_path('module', 'embed_widgets') . '/embed_button.gif', t('Embed this content on your site.'), t('Embed this content on your site.'));
@@ -1588,7 +1588,7 @@
     }
   }
 
-  $output .= "<h2>" . t('Widget Sources') . "</h2>";
+  $output = "<h2>" . t('Widget Sources') . "</h2>";
   $output .= theme('table', $header, $rows);
   $output .= theme('pager', NULL, 25, 0);
 
@@ -1729,7 +1729,7 @@
  * @see embed_widgets_ui_source_edit_submit()
  */
 function embed_widgets_ui_source_edit(&$form_state, $source = array()) {
-  if ($source) {
+  if (isset($source['title'])) {
     drupal_set_title(t('Edit %title', array('%title' => $source['title'])));
   }
   $ahah = array();
@@ -1770,7 +1770,7 @@
   $form['basic_info']['title'] = array(
     '#type' => 'textfield',
     '#title' => t('Title'),
-    '#default_value' => $source['title'],
+    '#default_value' => isset($source['title']) ? $source['title'] : '',
     '#size' => 30,
     '#maxlength' => 35,
     '#required' => TRUE,
@@ -1778,7 +1778,7 @@
   $form['basic_info']['description'] = array(
     '#type' => 'textfield',
     '#title' => t('Description'),
-    '#default_value' => $source['description'],
+    '#default_value' => isset($source['description']) ? $source['description'] : '',
     '#size' => 60,
     '#maxlength' => 255,
     '#required' => TRUE,
@@ -1812,7 +1812,7 @@
     '#description' => t('Select the type of element you would like to embed.'),
   );
   if (isset($source['sid'])) {
-    $form['config']['type']['#default_value'] = $source['type'];
+    $form['config']['type']['#default_value'] = isset($source['type']) ? $source['type'] : '';
     $form['config']['type']['#disabled'] = TRUE;
     $form['config']['type']['#description'] = t('This cannot be changed after it has been set.');
     if ($source['type'] == 'page') {
@@ -2151,9 +2151,8 @@
     $view_list = array('' => '');
     
     foreach ($views as $view) {
-      if (!$view->disabled) {
-        $title = $view->display['default']->display_options['title'];
-        if ($title) {
+      if (empty($view->disabled)) {
+        if (!empty($view->display['default']->display_options['display_title'])) {
           $view_list[$view->name] = $view->name . ': ' . $view->display['default']->display_options['title'];
         }
         else {
@@ -2272,7 +2271,7 @@
 function _embed_widgets_ui_ahah_view_args_form($view, $display = 'default', $defaults = array()) {
   $form = array();
   $view = views_get_view($view);
-  $arguments = $view->display[$display]->display_options['arguments'];
+  $arguments = isset($view->display[$display]->display_options['arguments']) ?$view->display[$display]->display_options['arguments'] : array();
   if ($view && !empty($arguments)) {
     $form['config']['new_source']['view']['arguments'] = array(
       '#type' => 'fieldset',
