Диалог настроек

@return string

@since 4.01
171763
public function settings()
    {
        $form = array(
            'name' => 'SettingsForm',
            'caption' => $this->title . ' ' . $this->version,
            'width' => '500px',
            'fields' => array (
                array('type' => 'hidden', 'name' => 'update', 'value' => $this->name),
                array('type' => 'checkbox', 'name' => 'notes', 'label' => 'Включить заметки'),
            ),
            'buttons' => array('ok', 'apply', 'cancel'),
        );

        /** @var TAdminUI $page */
        $page = Eresus_Kernel::app()->getPage();
        $html = $page->renderForm($form, $this->settings);
        return $html;
    }
166566
public function toString()
    {
        if ($this->hidden) {
            return '';
        }
        
        $result = trim($this->getName() . ' ' . (!empty($this->version) && !$this->version->hidden ? $this->getVersion() : ''));

        if (empty($result) && isset($this->using)) {
            return $this->using->toString();
        }

        return $result;
    }
973783
public function toString() {
		$txt = $this->getId ();
		$data = $this->getDataRaportu ();
		if ($data instanceof \DateTime) {
			$txt .= $this->getDataRaportu ()->format ( "Y-m-d" );
		} else {
			$txt .= $this->getDataRaportu ();
		}
		return $txt;
	}
1192444
protected function getToStringMethod()
    {
        $primary_string = $this->getParameter('primary_string');
        $i18n_languages = $this->getLocales();
        $primary_string_column =  count($i18n_languages) ? $primary_string : $this->getColumnForParameter('primary_string');
        $get_primary_string = 'get'.(count($i18n_languages) ? $this->CamelCase($primary_string) : $primary_string_column->getPhpName());

        if(!$primary_string_column) {
            $this->exceptionError('Not found column "'.$primary_string.'" in table '.$this->getTable()->getName());
        }

        $toString = '

    /**
     * Отдаём PrimaryString
     *
     * @return string
     */
    public function __toString() {';

        //есть языковые версии
        if (count($i18n_languages)) {
            $languages = 'array(';
            foreach ($i18n_languages as $lang) {
                $languages.='"'.$lang.'",';
            }
            $languages.=')';

            $toString .= '
        $to_string = $this->isNew() ? "New object" : "";
        $languages = '.$languages.';
        foreach ($languages as $language) {
            $str = $this->setLocale($language)->'.$get_primary_string.'();
            if ($str) {
		        $to_string = $str;
                break;
            }
        }
        if (mb_strlen($to_string, "UTF-8")>26) {
            $to_string = mb_substr($to_string, 0, 26, "utf-8")."...";
        }
        ';
            if ($this->getTable()->hasColumn('slug')) {
                $toString .= '$to_string = $to_string ? $to_string : $this->getSlug();
        ';
            }
        $toString .= 'return $to_string;';
        } else { //нет языковых версий
            $toString .= '
        return $this->'.$get_primary_string.'() ? $this->'.$get_primary_string.'() : "New object";';
        }
        $toString .= '
    }
    ';
        return $toString;
    }
876162
public function toString()
    {
        if ($this->max !== -1) {
            return vsprintf('{length: %d <= x <= %d}', [
                $this->min,
                $this->max,
            ]);
        }

        return vsprintf('{length: %d <= x}', [
            $this->min,
        ]);
    }
672520
public function getSlug()
    {
        $name = $this->getName();
        if (!isset($this->slugs[$name])) {
            $slug = Str::snake($name, '-');
            $this->slugs[$name] = Str::slug($slug);
        }

        return $this->slugs[$name];
    }
587030
public function parse()
	{
		$matches = array();

		// строка вида {env._SERVER.LC_NAME}
		if (preg_match_all('/\{env\.([\w\.]+)\}/im', $this->record->formatted, $macrosList) > 0)
		{
			foreach ($macrosList[1] as $match)
			{
				$parts = explode(".", $match);
				$array = @$GLOBALS[$parts[0]];
				array_shift($parts);
				$val = $array;

				foreach ($parts as $i => $key)
				{
					if (is_array($val))
						$val = @$val[$key];
					else if (is_object($val))
						$val = $val->{$key};
				}

				if (is_array($val) || is_object($val))
					$val = print_r($val, 1);

				$this->record->formatted = str_replace("{env." . $match . "}", $val, $this->record->formatted);
			}
		}

		return $this->record;
	}
693133
private function nameFull() {return dfc($this, function() {return
		$this->isTop()
		? df_trim_text_right($this->getName(), '[value]')
		// Анонимные филдсеты не добавляют своё имя в качестве префикса имён полей.
		: (!$this->_anonymous ? $this->getId() : $this->_parent->nameFull())
	;});}
881935
public function toString()
    {
        $result = "";
        if ($this->scheme) {
            $result .= $this->scheme.'://';
        }
        if ($this->user) {
            $result .= $this->user;
            if ($this->pass) {
                $result .= $this->user;
            }
            $result .= '@';
        }
        if ($this->host) {
            $result .= $this->host;
        }
        if ($this->port) {
            $result .= ':'.$this->port;
        }
        if ($this->pathSegments) {
            $result .= '/'.implode('/', $this->pathSegments);
        }
        if ($this->parameters) {
            $result .= '?'.http_build_query($this->parameters);
        }
        if ($this->fragment) {
            $result .= '#'.$this->fragment;
        }
        return $result;
    }
1202961
public function getModules()
    {
        if (!$this->_modules) {
        
            $translator = $this->application->getTranslator();
            $this->_modules = [
                'structure' => [
                	  'position'  => MENU_SITE,
                      'name' 	  => $translator->_('Структура и материалы'),
					  'iconCls'   => 'tree-folder-visible',
                      'class'     => 'Cetera.panel.Structure'
                ],			
                'materials' => [
                	  'position'  => MENU_SITE,
                      'name' 	  => $translator->_('Материалы'),
                	  'icon'      => 'images/math2.gif',
					  'iconCls'   => 'x-fa fa-file-text',
                      'class'     => 'Cetera.panel.MaterialsByCatalog'
                ]
            ];          
            
            if ($this->application->getUser() && $this->application->getUser()->allowAdmin()) {
        
                $this->_modules['widgets'] = array(
                	  'position' => MENU_SITE,
                      'name' 	 => $translator->_('Шаблоны виджетов'),
                	  'icon'     => 'images/widget_icon.png',
					  'iconCls'  => 'x-fa fa-file-code-o',
                	  'class'    => 'Cetera.widget.templates.Panel',
					  'ext6_compat'=> true
                );
		
                $this->_modules['widget_areas'] = array(
                	  'position' => MENU_SITE,
                      'name' 	 => $translator->_('Области'),
                	  'icon'     => 'images/widget_icon.png',
					  'iconCls'  => 'x-fa fa-cog',
                	  'class'    => 'Cetera.widget.Panel'
                ); 
                
                $this->_modules['menus'] = array(
                	  'position' => MENU_SITE,
                      'name' 	   => $translator->_('Меню'),
                	  'icon'     => 'images/icon_menu.png',
					  'iconCls'  => 'x-fa fa-bars',
                	  'class'    => 'Cetera.panel.Menu'
                );   

                $this->_modules['setup'] = array(
                			'position' => MENU_SERVICE,
                            'name' 	   => $translator->_('Настройки'),
                			'icon'     => 'images/setup_small.gif',
							'iconCls'  => 'x-fa fa-cogs',
                			'class'    => 'Cetera.panel.Setup'
                );				
            
                $this->_modules['types'] = array(
                			'position' => MENU_SERVICE,
                            'name' 	   => $translator->_('Типы материалов'),
                			'icon'     => 'images/setup_small.gif',
							'iconCls'  => 'x-fa fa-cogs',
                			'class'    => 'Cetera.panel.MaterialTypes'
                );
                
                $this->_modules['users'] = array(
                			'position' => MENU_SERVICE,
                            'name' 	   => $translator->_('Пользователи'),
                			'icon'     => 'images/user.gif',
							'iconCls'  => 'x-fa fa-user',
                			'class'    => 'Cetera.users.MainPanel'
                );
                
                $this->_modules['groups'] = array(
                	  'position' => MENU_SERVICE,
                      'name' 	   => $translator->_('Группы пользователей'),
                      'url'      => 'include/ui_groups.php',
                	  'icon'     => 'images/users.gif',
					  'iconCls'  => 'x-fa fa-users',
                	  'class'    => 'GroupsPanel'
                );
                
                $this->_modules['eventlog'] = array(
					'position' => MENU_SERVICE,
					'name' 	   => $translator->_('Журнал'),
					'icon'     => 'images/audit1.gif',
					'class'    => 'EventlogPanel',
					'iconCls'  => 'x-fa fa-file-text-o',
					'class'    => 'Cetera.eventlog.Panel',
                ); 
                
                $this->_modules['dbrepair'] = array(
					'position' => MENU_SERVICE,
					'name' 	   => $translator->_('Проверка и ремонт БД'),
					'icon'     => 'images/icon_repair.gif',
					'iconCls'  => 'x-fa fa-medkit',
					'class'    => 'Cetera.panel.Repair',
					'ext6_compat'=> true
                );
				
                $this->_modules['mail_templates'] = array(
					'position' => MENU_SERVICE,
					'name' 	   => $translator->_('Почтовые шаблоны'),
					'icon'     => 'images/mail.gif',
					'iconCls'  => 'x-fa fa-envelope',
					'class'    => 'Cetera.grid.MailTemplates',
                );				
                
                $this->_modules['plugins'] = array(
					'position' => MENU_SERVICE,
					'name' 	   => $translator->_('Плагины'),
					'icon'     => 'images/plugin.png',
					'class'    => 'Cetera.plugin.List',
					'iconCls'  => 'x-fa fa-plug'
                );
                
                $this->_modules['themes'] = array(
					'position' => MENU_SERVICE,
					'name' 	   => $translator->_('Темы'),
					'icon'     => 'images/16X16/gallery.gif',
					'iconCls'  => 'x-fa fa-picture-o',
					'class'    => 'Cetera.theme.List',
                );                
                 
            }           
        
        }
        
        return $this->_modules + $this->_user_modules;
    }
1225218
public function toString()
    {
        $cookies = '';
        foreach ($this->getCookies() as $cookie) {
            $cookies .= 'Set-Cookie: '.$cookie."\r\n";
        }

        return parent::toString().$cookies;
    }
5253
public function getDsn()
    {
        if (!$this->config) {
            return '';
        }
        $dsn = array();
        $dbName = null;

        if ($this->config->getName()) {
            $dbName = $this->config->getName();
        }

        if ($this->config->getHost()) {
            if ($this->config->getPort()) {
                $dsn[] = sprintf('dbname=//%s:%s/%s',
                    $this->config->getHost(),
                    $this->config->getPort(),
                    $dbName
                );
            } else {
                $dsn[] = sprintf('dbname=//%s/%s',
                    $this->config->getHost(),
                    $dbName
                );
            }
        } else {
            $dsn[] = 'dbname='.$dbName;
        }

        if ($this->config->getChar()) {
            $dsn[] = 'charset='.$this->config->getChar();
        }

        return $this->getPrefix().implode(';', $dsn);
    }
471052
protected function getHostName()
    {
        // Сначала проверьте наличие прокси-сервера
        $header = $this->getHeader('X_FORWARDED_HOST');
        if ($header && $this->isValidForwardedHost($header)) {
            $elements = explode(',', $header);
            $host = $elements[count($elements) - 1];
        } elseif (!$host = $this->getHeader('HOST')) {
            if (!$host = $this->getServerVar('SERVER_NAME')) {
                $host = $this->getServerVar('SERVER_ADDR');
            }
        }

        // обрезать и удалять номер порта с хоста
        // host в нижнем регистре согласно RFC 952/2181
        $host = strtolower(preg_replace('/:\d+$/', '', trim($host)));

        //Номер порта
        $scheme = $this->getHttpScheme();
        $port = $this->getCurrentPort();
        $appendPort = ':' . $port;

        //Не добавляйте номер порта, если нормальный порт.
        if (($scheme == 'http' && $port == '80') || ($scheme == 'https' && $port == '443')) {
            $appendPort = '';
        }

        return $host . $appendPort;
    }
1362309
public function toString() : string
   {

      if ( empty( $this->_subDomainName ) )
      {

         if ( null === $this->_sld )
         {
            return '';
         }

         return $this->_sld->toString();

      }

      if ( null === $this->_sld )
      {
         return $this->_subDomainName;
      }

      return $this->_subDomainName . '.' . $this->_sld->toString();

   }
283550
public function toString()
    {
        $driver  = $this->getDriver();
        $prefix  = $driver->getTablePrefix();
        $query   = 'SHOW '.$this->show;

        if($this->from)
        {
            $table  = (in_array($this->show, array('FULL COLUMNS', 'COLUMNS', 'INDEX', 'INDEXES', 'KEYS')) ? $prefix : '').$this->from;
            $query .= ' FROM '.$driver->quoteIdentifier($table);
        }

        if($this->like) {
            $query .= ' LIKE '.$driver->quoteIdentifier($this->like);
        }

        if($this->where)
        {
            $query .= ' WHERE';

            foreach($this->where as $where)
            {
                if(!empty($where['combination'])) {
                    $query .= ' '.$where['combination'];
                }

                $query .= ' '.$driver->quoteIdentifier($where['condition']);
            }
        }

        if($this->_parameters) {
            $query = $this->_replaceParams($query);
        }

        return $query;
    }
1092611
protected function toString(): string
    {
        $normalized = sprintf('%s%s', $this->prefix, implode(DIRECTORY_SEPARATOR, $this->stack));

        return trim($normalized);
    }
1315252
public function toString()
    {
        $newLine = "\n";
        $string = $newLine . $newLine;

        $i = 0;
        foreach ($this->dns as $dns) {
            ++$i;
            $string .= 'DNS.' . $i . ' = ' . $dns .$newLine;
        }

        $i = 0;
        foreach ($this->ip as $ip) {
            ++$i;
            $string .= 'IP.' . $i . ' = ' . $ip .$newLine;
        }

        $i = 0;
        foreach ($this->url as $url) {
            ++$i;
            $string .= 'URL.' . $i . ' = ' . $url .$newLine;
        }

        return $string;
    }