Assigns site properties.
1218
def assign_site_properties(self, slab, height=0.9):
        
        if 'surface_properties' in slab.site_properties.keys():
            return slab
        else:
            surf_sites = self.find_surface_sites_by_height(slab, height)
        surf_props = ['surface' if site in surf_sites
                      else 'subsurface' for site in slab.sites]
        return slab.copy(
            site_properties={'surface_properties': surf_props})
804401
private void initSite() {

        Object o = null;
        if (CmsStringUtil.isEmpty(getParamAction()) || CmsDialog.DIALOG_INITIAL.equals(getParamAction())) {
            // this is the initial dialog call
            if (CmsStringUtil.isNotEmpty(m_paramSites)) {
                // edit an existing site, get it from manager
                o = OpenCms.getSiteManager().getSiteForSiteRoot(m_paramSites);
            }
        } else {
            // this is not the initial call, get site from session
            o = getDialogObject();
        }
        if (o instanceof CmsSite) {
            // reuse site stored in session
            m_site = new CmsSiteBean((CmsSite)o);
        } else if (o instanceof CmsSiteBean) {
            // create a new site
            m_site = (CmsSiteBean)o;
        } else if (DIALOG_NEW.equals(getParamEditaction())) {
            m_site = new CmsSiteBean();
        } else {
            try {
                getToolManager().jspForwardTool(this, "/sites", new HashMap<String, String[]>());
            } catch (Exception e) {
                // noop
            }
        }

        if (!m_site.hasSecureServer()) {
            m_site.setSecureUrl("");
        }
        try {
            CmsObject clone = OpenCms.initCmsObject(getCms());
            clone.getRequestContext().setSiteRoot("");
            String iconPath = m_site.getSiteRoot() + "/" + CmsSiteFaviconDialog.ICON_NAME;
            if (clone.existsResource(iconPath)) {
                m_site.setFavicon(iconPath);
            }
        } catch (Throwable t) {
            // noop
        }

        if (m_site.getSiteRoot() != null) {
            setSitename(CmsResource.getName(m_site.getSiteRoot()));
        }

        CmsModule module = OpenCms.getModuleManager().getModule(MODULE_NAME);
        m_createou = Boolean.valueOf(module.getParameter(PARAM_CREATE_OU, Boolean.FALSE.toString())).booleanValue();
        m_ouDescription = module.getParameter(PARAM_OU_DESCRIPTION, "OU for: %(site)");
        setDialogObject(m_site);
    }
851012
public function init(){
		// set the htmleditor "content_css" based on the active site
		$htmlEditorConfig = HtmlEditorConfig::get_active();
		$site = Multisites::inst()->getActiveSite();
		if($site && $theme = $site->getSiteTheme()){

			$editorCSS = Config::inst()->get(CMSMain::class, 'multisites_editor_css_dir');
			if (isset($editorCSS[$theme])) {
				$cssFile = THEMES_DIR . "/$theme/" . $editorCSS[$theme] . "/editor.css";
			} else {
				$cssFile = THEMES_DIR . "/$theme/css/editor.css";
			}
			
			if(file_exists(BASE_PATH . '/' . $cssFile)){
				// NOTE: This ensures editor.css is invalided properly when it's updated.
				$cssFile = $cssFile.'?m='.filemtime(BASE_PATH.'/'.$cssFile);
				
				$htmlEditorConfig->setOption('content_css', $cssFile);
				
				if($this->owner->getRequest()->isAjax() && $this->owner instanceof CMSPageEditController){
					// Add editor css path to header so javascript can update ssTinyMceConfig.content_css
					$this->owner->getResponse()->addHeader('X-HTMLEditor_content_css', $cssFile);	
				}
				
			}	
		}
	}
936822
@Override
	public void postGenerate(Site site) {
		if(processors != null){
			for(Processor p: processors){
				p.postGenerate(site);
			}
		}
	}
635624
public function addRootPrivileges()
    {
        if ($this->addRootPrivilegeStatement == null) {
            $this->addRootPrivilegeStatement = $this->connection->prepare("
              INSERT INTO UserPrivileges (username, rootPrivileges, sitePrivileges, pageId) VALUES (?,1,0,NULL)");
        }
        $this->addRootPrivilegeStatement->execute(array($this->user->getUsername()));
        $this->rootPrivilege = 1;
    }
1344708
public void setSiteRoot(String siteRoot) {

        // site roots must never end with a "/"
        if (siteRoot.endsWith("/")) {
            m_siteRoot = siteRoot.substring(0, siteRoot.length() - 1);
        } else {
            m_siteRoot = siteRoot;
        }
    }
1233393
private function initSite()
    {
        $this->site = new Eresus_Site($this->getLegacyKernel());
        $this->site->setTitle(siteTitle);
        $this->site->setDescription(siteDescription);
        $this->site->setKeywords(siteKeywords);
        TemplateSettings::setGlobalValue('site', $this->site);
    }
525498
def add_site_property(self, property_name, values):
        
        if len(values) != len(self.sites):
            raise ValueError("Values must be same length as sites.")
        for site, val in zip(self.sites, values):
            site.properties[property_name] = val
854332
protected function updateSites($site, $target_env) {
    if (EnvironmentDetector::isAhOdeEnv($target_env)) {
      $this->updateOdeSites();
    }
    else {
      $this->updateAceSites($target_env);
    }
  }
149900
def set_properties(self, properties):
        """"""
        if isinstance(properties, dict):
            self.properties = properties
            self.sync_properties()
        else:
            self.text = properties
737711
def _set_sitevisitors(self):
        
        data = self._load_response('sitevisitors').get('query')

        siteviews = data.get('siteviews')
        if siteviews:
            values = [x for x in siteviews.values() if x]
            if values:
                self.data['visitors'] = int(sum(values) / len(values))
            else:
                self.data['visitors'] = 0
769836
public void setPropertiesLocation(String location) {
        Properties properties = load(null, new PathMatchingResourcePatternResolver(), location);
        if (properties != null && properties.size() > 0) {
            configure(properties);
        }
    }
1052580
public function setSite($site){
        if(!$this->setModified('site', $site)->isModified()){
            return $this;
        }
        $this->site = $site;

        return $this;
    }
842953
private void setSiteMatcherSites(Map<CmsSiteMatcher, CmsSite> siteMatcherSites) {

        m_siteMatcherSites = Collections.unmodifiableMap(siteMatcherSites);
        m_siteMatchers = Collections.unmodifiableList(new ArrayList<CmsSiteMatcher>(m_siteMatcherSites.keySet()));
    }
64133
def mount_site(self, site):
        
        if isinstance(site, string_types):
            site = import_string(site)
        site.play_actions(target=self)
769942
def setup(app):
    '''  '''
    app.connect('html-page-context', html_page_context)
    app.connect('build-finished',    build_finished)
    app.sitemap_links = set()
860971
public void setProperties(Map<String, Object> properties)
    {
        if (this.getTask() != null)
            this.getTask().setProperties(properties);
    }