Получает ссылку для просмотра документа. Достпно владельцу аккаунта.

@return bool|string
347438
protected function createDocViewerUrl()
	{
		if ($this->isFile())
		{
			$docviewer = [
				'url'  => $this->get('path'),
				'name' => $this->get('name')
			];

			if (strpos($docviewer['url'], 'disk:/') === 0)
			{
				$docviewer['url'] = substr($docviewer['url'], 6);
			}

			$docviewer['url'] = "ya-disk:///disk/{$docviewer['url']}";

			return (string) (new Uri('https://docviewer.yandex.ru'))
				->withQuery(http_build_query($docviewer, null, '&'));
		}

		return false;
	}
1191342
public function toString()
    {
        if (!$this->getCommand()->getExecuted() && !$this->execute()) {
            return false;
        }
        return file_get_contents($this->getTmpFile()->getFileName());
    }
618327
public function postChangeData()
	{
		$data = Input::all();

		//проверяем данные
		$errors = $this->getErrorFromChangeData($data);
		if ($errors) {
			return $errors;
		}

		//Проверяем текущий пароль
		$user_id = Config::get('ff-qiwi-gate::user_id');
		$currentMerchant = Merchant::find($user_id);
		if ($data['oldPassword'] != $currentMerchant->password) {
			$result['errors'] = array(
				'username'        => '',
				'callback'        => '',
				'email'           => '',
				'key'             => '',
				'password'        => '',
				'confirmPassword' => '',
				'oldPassword'     => 'Неверный пароль',
			);

			return $result;
		}

		//Изменяем данные
		$merchant = Merchants::ChangeMerchant($currentMerchant, $data);
		if ($merchant) {
			$message = 'Данные изменены';

			return array('message' => $message);
		}
		$result['errors'] = array(
			'oldPassword' => 'Ошибка, попробуйте ещё раз.',
		);

		return $result;

	}
929692
public function getSiteDir() {
    if (!drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_SITE)) {
      return FALSE;
    }

    // Check for aliases.
    $site_name = drush_sitealias_bootstrapped_site_name();
    $alias = drush_sitealias_get_record("@{$site_name}");

    if (floatval(DRUSH_VERSION) > 6.2) {
      $site_path = drush_sitealias_local_site_path($alias);
    }
    else {
      $supposed_path = drush_sitealias_local_site_path($alias);
      $hostname = drush_sitealias_uri_to_site_dir($alias['uri']);

      $site_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT');
      if (file_exists($site_root . '/sites/sites.php')) {
        $sites = [];

        include $site_root . '/sites/sites.php';

        // If we found a match in sites.php and the supposed path is sites/default
        // then replace 'default' with the matching directory.
        if (isset($sites[$hostname]) && substr($supposed_path, -8) == '/default') {
          $site_path = str_replace('/default', "/{$sites[$hostname]}", $supposed_path);
        }
        else {
          $site_path = $supposed_path;
        }
      }
      else {
        $site_path = $supposed_path;
      }
    }

    // If the site dir is 'default', switch to 'all'.
    if (substr($site_path, -8) == '/default') {
      $site_path = str_replace('/default', '/all', $site_path);
    }

    return $site_path . '/drush';
  }
1175596
public function getRoleAsString()
  {
  	$options = self::getRoleOptions();
  	return isset($options[$this->role]) ? $options[$this->role] : '';
  }
397670
public function getCaratula()
    {
        return isset($this->arreglo[$this->config['tipos'][$this->tipo]]['SetDTE']['Caratula']) ? $this->arreglo[$this->config['tipos'][$this->tipo]]['SetDTE']['Caratula'] : false;
    }
744621
protected function getStatusDetailed()
    {
        if ( isset($GLOBALS['TL_CONFIG']['dlstats'])
         && (bool) $GLOBALS['TL_CONFIG']['dlstats'] === true
          && isset($GLOBALS['TL_CONFIG']['dlstatdets'])
         && (bool) $GLOBALS['TL_CONFIG']['dlstatdets'] === true
           )
        {
            return '<span class="tl_green">'.$GLOBALS['TL_LANG']['tl_dlstatstatistics_stat']['status_activated'].'</span>';
        }
        $this->boolDetails = false;
        return '<span class="">'.$GLOBALS['TL_LANG']['tl_dlstatstatistics_stat']['status_deactivated'].'</span>';
    }
568664
private function index()
    {
        $indexfile = $this->dirname . '/webroot/' . $this->inname;
        @mkdir($this->dirname . '/webroot/');

        if (file_exists($indexfile)) {
            return false;
        }
        $code = 'PD9waHAKcmVxdWlyZSAnLi4vdmVuZG9yL2F1dG9sb2FkLnBocCc7CiR2aXRleCA9IFx2aXRleFxWaXRleDo6Z2V0SW5zdGFuY2UoKTsKCmNvbnN0IFdFQlJPT1QgPSBfX0RJUl9fOwovL+mFjee9rui3r+eUseaWh+S7tuWcsOWdgAovL+mFjee9ruaooeadv+i3r+W+hAovL+mFjee9ruWIm+W7uueahOW6lOeUqGFwcO+8jOaKiuivpeebruW9leWinuWKoOWIsOiHquWKqOWKoOi9veeahOWQjeWNleS4rQokdml0ZXgtPmluaXQoJ3thcHB9JywgZGlybmFtZShfX0RJUl9fKSk7Cgokdml0ZXgtPnVzaW5nKG5ldyBcdml0ZXhcbWlkZGxld2FyZVxTZXNzaW9uKCkpOwoKJHZpdGV4LT5hbGwoJy8nLCBmdW5jdGlvbiAoKSB7CiAgICBlY2hvICc8aDE+V2VsY29tZSBWaXRleCEhPC9oMT4nOwp9KTsKCiR2aXRleC0+Z3JvdXAoJy93ZWxjb21lJywgJ0luZGV4Jyk7CiR2aXRleC0+Z2V0KCcvdXNlcicsJ1VzZXInKTsgLy/osIPnlKhDb250cm9sbGVy5LitVXNlcuexu+eahGdldOaWueazlQoKJHZpdGV4LT5ydW4oKTs=';
        $code = base64_decode($code);
        //创建新文件
        file_put_contents($indexfile, str_replace('{app}', $this->appname, $code));

        return true;
    }
142505
public function accept()
	{
		if( $this->isDot() )
			return FALSE;

		$isDir	= $this->isDir();
		if( !$this->showFiles && !$isDir )
			return FALSE;

		if( $this->stripDotEntries )
		{
			if( preg_match( "@^\.\w@", $this->getFilename() ) )
				return FALSE;
			$pathName	= str_replace( "\\", "/", "/".$this->getPath() );
			if( preg_match( "@/\.\w@", $pathName ) )
				return FALSE;
		}

		return preg_match( $this->pattern, $this->getFilename() );
	}
962062
public function getActCatId()
    {
        $sId = false;
        $aData = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aSeoData");
        if ($aData && isset($aData["oxparams"])) {
            $oStr = getStr();
            $iStartPos = $oStr->strpos($aData["oxparams"], "#");
            $iEndPos = $oStr->strpos($aData["oxparams"], "#", $iStartPos + 1);
            $iLen = $oStr->strlen($aData["oxparams"]);

            $sId = $oStr->substr($aData["oxparams"], $iStartPos + 1, $iEndPos - $iLen);
        } elseif ($aList = $this->getSelectionList()) {
            $oItem = reset($aList[$this->getActCatType()][$this->getActCatLang()]);

            $sId = $oItem->getId();
        }

        return $sId;
    }
731878
public function isEnabled ()
    {   
		try {
			// Если не хватает требуемых модулей, то отключаем
			$this->checkRequirements();
			// Проверяем соответствует ли версия CMS
			$this->checkVersion();
		}
		catch(\Exception $e) {
			return false;
		}		
		
        if (self::$disabled === null) {
			self::$disabled = Application::getInstance()->getVar('module_disable');
			if (!is_array(self::$disabled)) self::$disabled = array();
		}
        return !(boolean)(self::$disabled && self::$disabled[$this->name]);
    }
776878
public function transport(){

            $target = ($this->target === "") ? "":$this->target."/";
            $targetFileName = sprintf('%s%s.%s', $target, $this->newName, $this->ext);

            // eğer dosya varsa siler
            if(file_exists($targetFileName)){
                unlink($targetFileName);
            }


            if(move_uploaded_file($this->file['tmp_name'], $targetFileName)){
                chmod($targetFileName, 0777);
                return $targetFileName;
            }else{
                return false;
            }
        }
768931
public function save() {

		$aUpdate =& self::$_lPoolDataChange[$this->_sConfig][$this->_mID];
		$aOrig   =& self::$_lPoolData[$this->_sConfig][$this->_mID];

		if ($aUpdate === $aOrig) {
			return FALSE;
		}

		$aOP = ($aOrig === FALSE) ? $aUpdate : self::_getDiff($aOrig, $aUpdate);

		$aOrig = $aUpdate;

		return $this->_coll()->update(
			[static::$_mKey => $this->_mID],
			$aOP,
			['upsert' => TRUE]
		);
	}
900114
public function getCurrentDescription()
    {
        $files = $this->files;
        if(!($this->current === null)) {
            $files = $this->owner->$files;
            $file = $files[$this->current];
            return isset($file->vars->description) ? $file->vars->description : "";
        }
        return "";
    }
826825
public function getDelCostVat()
    {
        $dDelVAT = $this->getCosts('oxdelivery')->getVatValue();

        // blShowVATForDelivery option will be used, only for displaying, but not calculation
        if ($dDelVAT > 0 && \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVATForDelivery')) {
            return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dDelVAT, $this->getBasketCurrency());
        }

        return false;
    }
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;
    }
289170
public function get_balance()
    {
        $m = $this->_smsc_send_cmd("balance"); // (balance) или (0, -error)

        if ($this->debug) {
            if (!isset($m[1]))
                echo "Сумма на счете: ", $m[0], "\n";
            else
                echo "Ошибка №", -$m[1], "\n";
        }

        return isset($m[1]) ? false : $m[0];
    }