Saves the page selection
333029
protected function OnSuccess()
    {
        $allParams = array();
        foreach ($this->oblParams as $param)
        {
            if ($this->Value($param)) {
                $allParams[$param] = $this->Value($param);
            }
        }
        $optParams = $this->serializer->LinesToArray($this->Value('OptionalParameters'));
        foreach ($optParams as $name=>$value)
        {
            if (!isset($allParams[$name]))
            {
                $allParams[$name] = $value;
            }
        }
        $this->SetJSFieldValue('#' . $this->prefix . 'Params', $this->serializer->ArrayToLines($allParams));
        $this->SetJSFieldValue('#' . $this->prefix . 'Page', $this->page->GetID());
        $this->SetJSFieldValue('#' . $this->prefix . 'Fragment', $this->Value('Fragment'));
        $this->SetJSHtml('#' . $this->prefix . 'Url', FrontendRouter::PageUrl($this->page, $allParams, $this->Value('Fragment')));
        $this->CloseModal();
    }
1051264
public function saveLean() {
		$fh = fopen($this->getDirname().'/'.$this->getLeanName(),'w');
		fwrite($fh, $this->leanCSS->render());	
	}
720671
function() {
      var t = this;
      t.saveChanges();

      // Open the new component dialog if no components exist
      if (t.model.get('components').length === 0) {
        t.pageView.newComponent();
      }
    }
118494
function Save()
    {
        $this->contentRights->Save();
        if (!$this->rights)
        {
            $this->rights = new BackendPageRights();
        }
        $this->rights->SetCreateIn($this->Value('CreateIn'));
        $this->rights->SetEdit($this->Value('Edit'));
        $this->rights->SetMove($this->Value('Move'));
        $this->rights->SetRemove($this->Value('Remove'));
        $this->rights->SetContentRights($this->contentRights->Rights());
        $this->rights->Save();
    }
1053904
def store_selection(first_row=0, first_col=0, last_row = nil, last_col =nil)   #:nodoc:
    record   = 0x001D                  # Record identifier
    length   = 0x000F                  # Number of bytes to follow

    pane_position = @active_pane       # Pane position
    row_active    = first_row          # Active row
    col_active    = first_col          # Active column
    irefAct  = 0                       # Active cell ref
    cref     = 1                       # Number of refs

    row_first = first_row              # First row in reference
    col_first = first_col              # First col in reference
    row_last  = last_row || row_first  # Last  row in reference
    col_last  = last_col || col_first  # Last  col in reference

    # Swap last row/col for first row/col as necessary
    row_first, row_last = row_last, row_first if row_first > row_last
    col_first, col_last = col_last, col_first if col_first > col_last

    header = [record, length].pack('vv')
    data = [pane_position, row_active, col_active, irefAct, cref,
      row_first, row_last, col_first, col_last].pack('CvvvvvvCC')

    append(header, data)
  end
1241791
protected function submitEditPage()
    {
        if ($this->isPosted('delete')) {
            $this->deletePage();
        } else if ($this->isPosted('save') && $this->validateEditPage()) {
            $this->deleteImagesPage();
            if (isset($this->data_page['page_id'])) {
                $this->updatePage();
            } else {
                $this->addPage();
            }
        }
    }
668856
def _on_changed(self):
        """"""
        page = self._get_page()
        if not page.flag_autosave:
            page.flag_changed = True
            self._update_gui_text_tabs()
240191
def save(self):
        
        e = self.editor

        self._style = e.current_style
        self._show_line_numbers = e.show_line_numbers
        self._highlight_search = e.highlight_search
        self._show_ruler = e.show_ruler
        self._relative_number = e.relative_number
        self._cursorcolumn = e.cursorcolumn
        self._cursorline = e.cursorline
        self._colorcolumn = e.colorcolumn
1137629
public function save()
    {
        if( is_admin() && !empty( $_POST ) ) {
            do_action('wpExpressSettingsPageBeforeSave', $this, $_POST);

            foreach( $this->fields->toArray() as $fieldName => $field ) {

                $optionName = "{$this->fieldPrefix}{$fieldName}";

                if( isset( $_POST[$fieldName] ) ) {

                    update_option($optionName, $_POST[$fieldName]);
                    // Update the field value :D
                    $this->fields($fieldName)->setValue($_POST[$fieldName]);
                }

            }

            do_action('wpExpressSettingsPageAfterSave', $this, $_POST);
        }
    }
1343705
private void updatePage() {
		// retrieve page
		final int retrievalPage = page == LAST_PAGE ? pageCount : page;
		final List<Row> rows;
		try {
			rows = client.getExecutor().retrieveResultPage(resultDescriptor.getResultId(), retrievalPage);
		} catch (SqlExecutionException e) {
			close(e);
			return;
		}

		// convert page
		final List<String[]> stringRows = rows
				.stream()
				.map(CliUtils::rowToString)
				.collect(Collectors.toList());

		// update results
		if (previousResultsPage == retrievalPage) {
			// only use the previous results if the current page number has not changed
			// this allows for updated results when the key space remains constant
			previousResults = results;
		} else {
			previousResults = null;
			previousResultsPage = retrievalPage;
		}

		results = stringRows;

		// check if selected row is still valid
		if (selectedRow != NO_ROW_SELECTED) {
			if (selectedRow >= results.size()) {
				selectedRow = NO_ROW_SELECTED;
			}
		}

		// reset view
		resetAllParts();
	}
157334
function selectTab() {
      var href = tab.href.split('#')[1];
      var panel = layout.content_.querySelector('#' + href);
      layout.resetTabState_(tabs);
      layout.resetPanelState_(panels);
      tab.classList.add(layout.CssClasses_.IS_ACTIVE);
      panel.classList.add(layout.CssClasses_.IS_ACTIVE);
    }
1034643
public function saveSeoAction()
	{
		$idPage = $this->params()->fromRoute('idPage', $this->params()->fromQuery('idPage', ''));
		$translator = $this->serviceLocator->get('translator');
		
		$eventDatas = array('idPage' => $idPage);
		$this->getEventManager()->trigger('meliscms_page_saveseo_start', null, $eventDatas);
		
		// Get the form properly loaded
		$seoForm = $this->getSeoPageForm($idPage);

		$melisTablePageSeo = $this->serviceLocator->get('MelisEngineTablePageSeo');

		// Check if post
		$request = $this->getRequest();
		if ($request->isPost())
		{
            // Get values posted and set them in form
            $postValues = get_object_vars($request->getPost());

            if (!empty($postValues['pseo_url'])) {
                $postValues['pseo_url'] =  $this->cleanURL($postValues['pseo_url']);
            }

            if (!empty($postValues['pseo_canonical'])) {
                $postValues['pseo_canonical'] =  $this->cleanURL($postValues['pseo_canonical']);
            }

            $seoForm->setData($postValues);

            // Validate the form
			if ($seoForm->isValid())
			{
				// Get datas validated
				$datas = $seoForm->getData();
				
				$allEmpty = true;
				foreach ($datas as $data)
				{
					if (!empty($data))
					{
						$allEmpty = false;
						break;
					}
				}
				
				$success = 1;
				$datas['pseo_id'] = $idPage;
				
				if (substr($datas['pseo_url'], 0, 1) == '/')
					$datas['pseo_url'] = substr($datas['pseo_url'], 1, strlen($datas['pseo_url']));
				if (substr($datas['pseo_url_redirect'], 0, 1) == '/')
					$datas['pseo_url_redirect'] = substr($datas['pseo_url_redirect'], 1, strlen($datas['pseo_url_redirect']));
				if (substr($datas['pseo_url_301'], 0, 1) == '/')
					$datas['pseo_url_301'] = substr($datas['pseo_url_301'], 1, strlen($datas['pseo_url_301']));

				if (!$allEmpty)	
				{
					// Check for unicity of the URL declared
					if (!empty($datas['pseo_url']))
					{
						$datasPageSeo = $melisTablePageSeo->getEntryByField('pseo_url', $datas['pseo_url']);
						if (!empty($datasPageSeo))
						{
							$datasPageSeo = $datasPageSeo->current();
							if (!empty($datasPageSeo))
							{
								// Not this page of course
								if ($datasPageSeo->pseo_id != $idPage)
								{
									$pageNameDuplicate = '';
									$melisPage = $this->serviceLocator->get('MelisEnginePage');
									$datasPage = $melisPage->getDatasPage($datasPageSeo->pseo_id, 'saved');
									$pageTree = $datasPage->getMelisPageTree();
									if (!empty($pageTree))
										$pageNameDuplicate = ' ' . $pageTree->page_name . ' (' . $datasPageSeo->pseo_id . ')';
									
									// This URL is already used somewhere else
									return new JsonModel(array(
											'success' => 0,
											'datas' => array(),
											'errors' => array(
															array(
																	'pseo_url' => $translator->translate('tr_meliscms_page_save_error_SEO Url already used on') . $pageNameDuplicate,
																	'label' => $translator->translate('tr_meliscms_page_save_error_label_SEO Url')
																)
															)
									));;
								}
							}
						}
					}
					
					// Cleaning special char and white spaces on SEO Url
					$enginePage = $this->getServiceLocator()->get('MelisEngineTree');
					$datas['pseo_url'] = $enginePage->cleanString(mb_strtolower($datas['pseo_url']));
					// Checking for spaces
					if (preg_match('/\s/', $datas['pseo_url']))
					{
					    $datas['pseo_url'] = str_replace(" ", "", $datas['pseo_url']);
					}
					
				    $res = $melisTablePageSeo->save($datas, $idPage);
				}
				else
				{
					// All field are empty, let's delete the entry
					$melisTablePageSeo->deleteById($idPage);
				}
	
				$result = array(
						'success' => $success,
						'errors' => array(),
				);

			}
			else
			{
				// Add labels of errors
				$errors = $seoForm->getMessages();
				$melisMelisCoreConfig = $this->serviceLocator->get('MelisCoreConfig');
				$appConfigForm = $melisMelisCoreConfig->getItem(PageSeoController::PageSeoAppConfigPath, $idPage . '_');
				$appConfigForm = $appConfigForm['elements'];
				
				foreach ($errors as $keyError => $valueError)
				{
					foreach ($appConfigForm as $keyForm => $valueForm)
					{
						if ($valueForm['spec']['name'] == $keyError &&
								!empty($valueForm['spec']['options']['label']))
									$errors[$keyError]['label'] = $valueForm['spec']['options']['label'];
					}
				}
				
				// Get validation errors
				$result = array(
						'success' => 0,
						'errors' => array($errors),
				);

			}
		}
		else
		{
			$result = array(
					'success' => 0,
					'errors' => array(array('empty' => $translator->translate('tr_meliscms_form_common_errors_Empty datas'))),
			);
		}

		$this->getEventManager()->trigger('meliscms_page_saveseo_end', null, $result);
		
		return new JsonModel($result);
	}
749130
def save_model(self, request, page, form, change):
        
        language = form.cleaned_data['language']
        target = form.data.get('target', None)
        position = form.data.get('position', None)
        page.save()

        # if True, we need to move the page
        if target and position:
            try:
                target = self.model.objects.get(pk=target)
            except self.model.DoesNotExist:
                pass
            else:
                target.invalidate()
                page.move_to(target, position)

        for name in self.mandatory_placeholders:
            data = form.cleaned_data[name]
            placeholder = PlaceholderNode(name)
            extra_data = placeholder.get_extra_data(form.data)
            placeholder.save(page, language, data, change,
                extra_data=extra_data)

        for placeholder in get_placeholders(page.get_template()):
            if(placeholder.ctype in form.cleaned_data and placeholder.ctype
                    not in self.mandatory_placeholders):
                data = form.cleaned_data[placeholder.ctype]
                extra_data = placeholder.get_extra_data(form.data)
                placeholder.save(page, language, data, change,
                    extra_data=extra_data)

        page.invalidate()
192265
def save_bookmark(self, slot_num):
        """"""
        bookmarks = CONF.get('editor', 'bookmarks')
        editorstack = self.get_current_editorstack()
        if slot_num in bookmarks:
            filename, line_num, column = bookmarks[slot_num]
            if osp.isfile(filename):
                index = editorstack.has_filename(filename)
                if index is not None:
                    block = (editorstack.tabs.widget(index).document()
                             .findBlockByNumber(line_num))
                    block.userData().bookmarks.remove((slot_num, column))
        if editorstack is not None:
            self.switch_to_plugin()
            editorstack.set_bookmark(slot_num)
364354
def save_current_page(options = {})
        default_options = {:replacement => true}
        options = default_options.merge(options)
        to_dir = options[:dir] || default_dump_dir

        if options[:filename]
          file_name = options[:filename]
        else
          file_name = Time.now.strftime("%m%d%H%M%S") + ".html"
        end

        Dir.mkdir(to_dir) unless File.exists?(to_dir)
        file = File.join(to_dir, file_name)

        content = page_source
        base_url = @web_browser.context.base_url
        current_url = @web_browser.url
        current_url =~ /(.*\/).*$/
        current_url_parent = $1
        if options[:replacement] && base_url =~ /^http:/
          File.new(file, "w").puts absolutize_page_hpricot(content, base_url, current_url_parent)
        else
          File.new(file, "w").puts content
        end

      end
535569
function () {
            var me = this;
            if (!me.lastBk) {
                me.lastBk = me.selection.getRange().createBookmark(true);
            }
            me.container.style.display = 'none'
        }
1079684
function saveState( $pageEnd = 0 )
    {
        if ( $pageEnd )
        {
            // this will be called at a new page to return the state to what it was on the
            // end of the previous page, before the stack was closed down
            // This is to get around not being able to have open 'q' across pages
            $opt = $this->stateStack[$pageEnd]; // ok to use this as stack starts numbering at 1
            $this->setColor($opt['col'],1);
            $this->setStrokeColor($opt['str'],1);
            $this->objects[$this->currentContents]['c'].="\n".$opt['lin'];
            //$this->currentLineStyle = $opt['lin'];
        }
        else
        {
            $this->nStateStack++;
            $this->stateStack[$this->nStateStack]=array( 'col' => $this->currentColour,
                                                         'str' => $this->currentStrokeColour,
                                                         'lin' => $this->currentLineStyle );
        }
        $this->objects[$this->currentContents]['c'] .= "\nq";
    }