Displays the edit dashboard page
355412
public function editDashboard()
    {
        $this->setDashboard(false);
        $this->setTitleEditDashboard();
        $this->setBreadcrumbEditDashboard();

        $this->setData('dashboard', $this->data_dashboard);

        $this->submitEditDashboard();
        $this->outputEditDashboard();
    }
965146
public function editAction()
    {
        $model = $this->loadModel();
        if ($model->isObjectNew()) {
            $this->_forward('noroute');
            return;
        }

        if ($this->getRequest()->isPost()) {
            $postData = $this->getRequest()->getPost();
            try {
                foreach ($this->preprocessPostData($postData) as $key => $value) {
                    $model->setDataUsingMethod($key, $value);
                }
                $model->save();
                $this->_redirectUrl($this->getHelper()->getGridUrl());
                $this->_getSession()->addSuccess('Saved Successfully');
                return;
            } catch (Exception $e) {
                if ($e instanceof Zend_Db_Statement_Exception && $e->getChainedException() instanceof PDOException) {
                    $e = $e->getChainedException();
                }
                Mage::logException($e);
                $this->_getSession()->addError($e->getMessage());
            }
        }

        $this->loadLayout();
        $this->renderLayout();
    }
1111135
def dashboard_column(context, token):
    
    column_index = int(token.split_contents()[1])
    output = []
    for tag in settings.DASHBOARD_TAGS[column_index]:
        t = Template("{%% load %s %%}{%% %s %%}" % tuple(tag.split(".")))
        output.append(t.render(context))
    return "".join(output)
683112
function display_edit_field() {
        global $CFG, $DB, $OUTPUT;

        if (empty($this->field)) {   // No field has been defined yet, try and make one
            $this->define_default_field();
        }
        echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');

        echo '<form id="editfield" action="'.$CFG->wwwroot.'/mod/data/field.php" method="post">'."\n";
        echo '<input type="hidden" name="d" value="'.$this->data->id.'" />'."\n";
        if (empty($this->field->id)) {
            echo '<input type="hidden" name="mode" value="add" />'."\n";
            $savebutton = get_string('add');
        } else {
            echo '<input type="hidden" name="fid" value="'.$this->field->id.'" />'."\n";
            echo '<input type="hidden" name="mode" value="update" />'."\n";
            $savebutton = get_string('savechanges');
        }
        echo '<input type="hidden" name="type" value="'.$this->type.'" />'."\n";
        echo '<input name="sesskey" value="'.sesskey().'" type="hidden" />'."\n";

        echo $OUTPUT->heading($this->name(), 3);

        require_once($CFG->dirroot.'/mod/data/field/'.$this->type.'/mod.html');

        echo '<div class="mdl-align">';
        echo '<input type="submit" class="btn btn-primary" value="'.$savebutton.'" />'."\n";
        echo '<input type="submit" class="btn btn-secondary" name="cancel" value="'.get_string('cancel').'" />'."\n";
        echo '</div>';

        echo '</form>';

        echo $OUTPUT->box_end();
    }
943221
public function edit(string $id)
    {
        $savedWidgetData = [];
        $dashboard = $this->Dashboards->get($id, [
            'contain' => ['Widgets']
        ]);

        $dashboardWidgets = $dashboard->get('widgets');
        $dashboard->unsetProperty('widgets');

        /**
         * @var \Search\Model\Table\WidgetsTable $widgetsTable
         */
        $widgetsTable = TableRegistry::get('Search.Widgets');
        $widgets = $widgetsTable->getWidgets();

        $sequence = 0;

        foreach ($dashboardWidgets as $dw) {
            foreach ($widgets as $widget) {
                if ($dw->widget_id !== $widget['data']['id']) {
                    continue;
                }

                $widgetOptions = $widgetsTable->getWidgetOptions($dw, ['sequence' => $sequence]);

                $item = array_merge(
                    [
                        'id' => $widget['data']['id']
                    ],
                    [
                        'data' => $widget['data']
                    ],
                    $widgetOptions
                );
                unset($item['data']['content'], $item['data']['created'], $item['data']['modified']);
                if (!empty($item['data']['query'])) {
                    unset($item['data']['query']);
                }
                array_push($savedWidgetData, $item);

                $sequence++;
            }
        }

        if ($this->request->is(['patch', 'post', 'put'])) {
            $data = (array)$this->request->getData();

            $dashboard->unsetProperty('widgets');

            $dashboard = $this->Dashboards->patchEntity($dashboard, [
                'name' => $data['name'],
                'role_id' => $data['role_id']
            ]);

            if ($this->Dashboards->save($dashboard)) {
                $this->Flash->success((string)__('The dashboard has been saved.'));
                /** @var \Search\Model\Table\WidgetsTable */
                $widgetTable = TableRegistry::get('Search.Widgets');
                $widgetTable->trashAll([
                    'dashboard_id' => $dashboard->id
                ]);

                $data['widgets'] = !empty($data['options']) ? json_decode($data['options'], true) : [];
                if (!empty($data['widgets'])) {
                    $widgetsTable->saveDashboardWidgets($id, $data['widgets']);
                }

                return $this->redirect(['action' => 'view', $id]);
            } else {
                $this->Flash->error((string)__('The dashboard could not be saved. Please, try again.'));
            }
        }

        $roles = $this->Dashboards->Roles->find('list', ['limit' => 200]);

        $this->set(compact('dashboard', 'roles', 'widgets', 'savedWidgetData'));
        $this->set('columns', Configure::readOrFail('Search.dashboard.columns'));
        $this->set('_serialize', ['dashboard']);
    }
788854
public function display()
    {
        if (!$this->visible) {
            return;
        }

        parent::display();

        // add a hidden field so we can check if this list was submitted on
        // the process step
        $this->getForm()->addHiddenField($this->id . '_submitted', 1);

        if (count($this->pages) === 1) {
            $this->displaySinglePage(reset($this->pages));
        } else {
            $table = new SwatHtmlTag('table');
            $table->id = $this->id;
            $table->class = 'swat-radio-note-book';
            $table->open();

            echo '<tbody>';

            $count = 0;
            foreach ($this->pages as $page) {
                if (!$page->visible) {
                    continue;
                }

                $count++;

                $this->displayPage($page, $count);
            }

            echo '</tbody>';

            $table->close();

            Swat::displayInlineJavaScript($this->getInlineJavaScript());
        }
    }
179851
public function showDashboard()
    {
        $components = Component::orderBy('order')->get();
        $incidents = $this->getIncidents();
        $subscribers = $this->getSubscribers();

        $componentGroups = $this->getVisibleGroupedComponents();
        $ungroupedComponents = Component::ungrouped()->get();

        $welcomeUser = !Auth::user()->welcomed;
        if ($welcomeUser) {
            execute(new WelcomeUserCommand(Auth::user()));
        }

        $entries = null;
        if ($feed = $this->feed->latest()) {
            if (is_object($feed)) {
                $entries = array_slice($feed->channel->item, 0, 5);
            }
        }

        return View::make('dashboard.index')
            ->withPageTitle(trans('dashboard.dashboard'))
            ->withComponents($components)
            ->withIncidents($incidents)
            ->withSubscribers($subscribers)
            ->withEntries($entries)
            ->withComponentGroups($componentGroups)
            ->withUngroupedComponents($ungroupedComponents)
            ->withWelcomeUser($welcomeUser);
    }
773821
public function display() {
        global $PAGE, $COURSE;

        $this->require_definition_after_data();

        $config = new stdClass;
        if ($this->uistage->get_ui() instanceof import_ui) {
            $config->title = get_string('confirmcancelimport', 'backup');
        } else if ($this->uistage->get_ui() instanceof restore_ui) {
            $config->title = get_string('confirmcancelrestore', 'backup');
        } else {
            $config->title = get_string('confirmcancel', 'backup');
        }
        $config->question = get_string('confirmcancelquestion', 'backup');
        $config->yesLabel = $config->title;
        $config->noLabel = get_string('confirmcancelno', 'backup');
        $config->closeButtonTitle = get_string('close', 'editor');
        $PAGE->requires->yui_module(
            'moodle-backup-confirmcancel',
            'M.core_backup.confirmcancel.watch_cancel_buttons',
            array($config)
        );

        // Get list of module types on course.
        $modinfo = get_fast_modinfo($COURSE);
        $modnames = $modinfo->get_used_module_names(true);
        $PAGE->requires->yui_module('moodle-backup-backupselectall', 'M.core_backup.backupselectall',
                array($modnames));
        $PAGE->requires->strings_for_js(array('select', 'all', 'none'), 'moodle');
        $PAGE->requires->strings_for_js(array('showtypes', 'hidetypes'), 'backup');

        parent::display();
    }
844511
public function showAction()
    {
        $this->html->h2($this->getTopicTitle());

        $context = $this->_getParam('id', 'gems');
        $this->_upgrades->setContext($context);
        if ($info = $this->_upgrades->getUpgradesInfo($context)) {
            $this->html->table(array('class'=>'browser'))->tr()
                ->th($this->_('Context'))->td($info['context'])
                ->tr()
                ->th($this->_('Level'))->td($info['level']);
            $data = $this->_upgrades->getUpgrades();
            foreach($data as $level => $row) {
                foreach($this->menu->getCurrent()->getChildren() as $menuItem) {
                    if ($menuItem->is('allowed', true)) {
                        $show = true;
                        if ($level <= $info['level'] && $menuItem->is('action','execute-to')) {
                            //When this level is < current level don't allow to execute from current level to this one
                            $show = false;
                        }
                        if ($level <= $info['level'] && $menuItem->is('action','execute-from')) {
                            //When this level is < current level don't allow to execute from current level to this one
                            $show = false;
                        }
                        if ($show) {
                            $row['action'][] = $menuItem->toActionLinkLower($this->getRequest(), $row, array('from'=>$level, 'to'=>$level));
                        }
                    }
                }
                $row['level'] = $level;
                $data[$level] = $row;
            }
            $displayColumns = array('level' => $this->_('Level'),
                                    'info'   => $this->_('Description'),
                                    'action' => $this->_('Action'));
            $this->addSnippet('SelectiveTableSnippet', 'data', $data, 'class', 'browser', 'columns', $displayColumns);
        } else {
            $this->html[] = sprintf($this->_('Context %s not found!'), $context);
        }

        if ($parentItem = $this->menu->getCurrent()->getParent()) {
            $this->html[] = $parentItem->toActionLink($this->getRequest(), $this->_('Cancel'));
        }
    }
680382
protected function submitEditDashboard()
    {
        if ($this->isPosted('save')) {
            $this->validateEditDashboard();
            $this->saveDashboard();
        } else if ($this->isPosted('delete') && isset($this->data_dashboard['dashboard_id'])) {
            $this->deleteDashboard();
        }
    }
429737
protected function displayOutcome()
    {
        $this->info('______________________________________');
        $this->info(' ');
        $this->info('You can now visit: "'.config('app.url').'/'.config('eyewitness.base_uri').'" to see your dashboard (you will need your keys above to login).');
        $this->info(' ');
    }
442155
public function edit() {
        $ga_id = Filter::getInteger('ga_id');
        $ga = $this->provider->getGeoAnalysis($ga_id, false);
        
        $this->renderEdit($ga);
    }
815899
public function editAction()
    {
        $params     = $this->params();
        $request    = $this->getRequest();
        $service    = $this->getServiceLocator();
        $cid        = $params->fromQuery( 'contentId' );
        $pid        = $params->fromRoute( 'paragraphId' );
        $locale     = $service->get( 'AdminLocale' )->getCurrent();
        $model      = $service->get( 'Grid\Paragraph\Model\Dashboard\Model' );
        $permission = $service->get( 'Grid\User\Model\Permissions\Model' );
        $dashboard  = $model->setLocale( $locale )->find( $pid );
        $customize  = $permission->isAllowed( 'paragraph.customize', 'edit' );

        if ( empty( $dashboard ) )
        {
            $this->getResponse()
                 ->setStatusCode( 404 );

            return;
        }

        $paragraph = $dashboard->paragraph;

        if ( ! $paragraph->isEditable() )
        {
            $this->getResponse()
                 ->setStatusCode( 403 );

            return;
        }

        if ( $cid && $paragraph instanceof ContentDependentAwareInterface )
        {
            $content = $service->get( 'Grid\Paragraph\Model\Paragraph\Model' )
                               ->setLocale( $locale )
                               ->find( $cid );

            if ( $content instanceof AbstractRoot )
            {
                $paragraph->setDependentContent( $content );
            }
        }

        $form = $dashboard->getForm( $service->get( 'Form' ), $customize );
        $view = new ViewModel( array(
            'form'      => $form,
            'success'   => null,
        ) );

        if ( $request->isPost() )
        {
            $form->setData( $request->getPost() );
            $view->setVariable( 'success',
                                $form->isValid() && $dashboard->save() );
        }

        return $view->setTerminal( true );
    }
23883
public function dashboardCpts()
    {

        $args = array(
            'public' => true ,
            '_builtin' => false
        );

        $output = 'object';
        $operator = 'and';
        $post_types = get_post_types($args, $output, $operator);

        foreach ($post_types as $post_type) {
            $num_posts = wp_count_posts($post_type->name);
            $num = number_format_i18n($num_posts->publish);
            $text = _n($post_type->labels->singular_name, $post_type->labels->name, intval($num_posts->publish));

            if (current_user_can('edit_posts')) {
                $num = "<a href='edit.php?post_type=$post_type->name'>$num";
                $text = "$text</a>";
            }

            echo '<li class="post-count">' . $num . ' ' . $text . '</li>';
        }
    }
220950
public function index()
    {
        $view = $this->_getDashboardView('@Dashboard/index');
        $view->dashboardSettingsControl = new DashboardManagerControl();
        $view->hasSomeAdminAccess = Piwik::isUserHasSomeAdminAccess();
        $view->dashboards = array();
        if (!Piwik::isUserIsAnonymous()) {
            $login = Piwik::getCurrentUserLogin();

            $view->dashboards = $this->dashboard->getAllDashboards($login);
        }
        return $view->render();
    }
1143852
def on_edit_grid(self, event):
        """"""
        if not self.changes:
            self.changes = {event.Row}
        else:
            self.changes.add(event.Row)
        #self.changes = True
        try:
            editor = event.GetControl()
            editor.Bind(wx.EVT_KEY_DOWN, self.onEditorKey)
        except AttributeError:
            # if it's a EVT_GRID_EDITOR_SHOWN, it doesn't have the GetControl method
            pass
243318
public function display()
    {
        if (!$this->visible) {
            return;
        }

        SwatWidget::display();

        // textarea tags cannot be self-closing when using HTML parser on XHTML
        $value = $this->value === null ? '' : $this->value;

        // escape value for display because we actually want to show entities
        // for editing
        $value = htmlspecialchars($value);

        $div_tag = new SwatHtmlTag('div');
        $div_tag->class = 'swat-textarea-editor-container';
        $div_tag->open();

        $textarea_tag = new SwatHtmlTag('textarea');
        $textarea_tag->name = $this->id;
        $textarea_tag->id = $this->id;
        $textarea_tag->class = $this->getCSSClassString();
        // NOTE: The attributes rows and cols are required in
        //       a textarea for XHTML strict.
        $textarea_tag->rows = $this->rows;
        $textarea_tag->cols = $this->cols;
        $textarea_tag->setContent($value);
        $textarea_tag->accesskey = $this->access_key;

        // set element styles if width and/or height are specified
        if ($this->width !== null || $this->height !== null) {
            if ($this->width !== null && $this->height !== null) {
                $textarea_tag->style = sprintf(
                    'width: %s; height: %s;',
                    $this->width,
                    $this->height
                );
            } elseif ($this->width !== null) {
                $textarea_tag->style = sprintf('width: %s;', $this->width);
            } else {
                $textarea_tag->style = sprintf('height: %s;', $this->height);
            }
        }

        if (!$this->isSensitive()) {
            $textarea_tag->disabled = 'disabled';
        }

        $textarea_tag->display();

        // hidden field to preserve editing mode in form data
        $input_tag = new SwatHtmlTag('input');
        $input_tag->type = 'hidden';
        $input_tag->id = $this->id . '_mode';
        $input_tag->value = $this->mode;
        $input_tag->display();

        $div_tag->close();

        Swat::displayInlineJavaScript($this->getInlineJavaScript());
    }