Beispiel #1
0
             if (!($Plugin =& $Plugins->get_by_code($code))) {
                 debug_die('Requested plugin not found');
             }
             if (!$Plugins->has_event($Plugin->ID, 'SkinTag')) {
                 debug_die('Requested plugin does not support SkinTag');
             }
             $edited_ComponentWidget = new ComponentWidget(NULL, 'plugin', $code);
             break;
         default:
             debug_die('Unhandled widget type');
     }
     $edited_ComponentWidget->set('coll_ID', $Blog->ID);
     $edited_ComponentWidget->set('sco_name', $container);
     $edited_ComponentWidget->set('enabled', 1);
     // INSERT INTO DB:
     $edited_ComponentWidget->dbinsert();
     $Messages->add(sprintf(T_('Widget «%s» has been added to container «%s».'), $edited_ComponentWidget->get_name(), T_($container)), 'success');
     switch ($display_mode) {
         case 'js':
             // this is a js call, lets return the settings page -- fp> what do you mean "settings page" ?
             // fp> wthis will visually live insert the new widget into the container; it probably SHOULD open the edit properties right away
             send_javascript_message(array('addNewWidgetCallback' => array($edited_ComponentWidget->ID, $container, $edited_ComponentWidget->get('order'), '<a href="' . regenerate_url('blog', 'action=edit&amp;wi_ID=' . $edited_ComponentWidget->ID) . '" class="widget_name">' . $edited_ComponentWidget->get_desc_for_list() . '</a> ' . $edited_ComponentWidget->get_help_link(), $edited_ComponentWidget->get_cache_status(true)), 'editWidget' => array('wi_ID_' . $edited_ComponentWidget->ID)));
             break;
         case 'normal':
         default:
             // take usual action
             header_redirect('?ctrl=widgets&action=edit&wi_ID=' . $edited_ComponentWidget->ID);
             break;
     }
     break;
 case 'update':