Return section output mode constant or false, based on engine status.

@return int|boolean
@access private
354016
private function mode()
    {
        $status = $this->engine()->status();
        if ($status & Engine::STATUS_IN_LAYOUT || $status & Engine::STATUS_IN_PARTIAL) {
            return SectionInterface::MODE_OUTPUT;
        }

        return false;
    }
49344
protected function getReadingmode()
    {
        $default = Versioned::get_reading_mode();

        // Non dataobjects use global mode
        if (! $this->owner instanceof DataObject) {
            return $default;
        }

        // Respect source query params (so records selected from live will have live urls)
        $queryParams = $this->owner->getSourceQueryParams();
        return ReadingMode::fromDataQueryParams($queryParams)
            // Fall back to default otherwise
            ?: $default;
    }
1082396
public function AvailableSectionTypes()
    {
        $AvailableTypes = ClassInfo::subclassesfor('Section');
        unset($AvailableTypes['Section']);

        # Get section options from each page type.
        $pageTypeOptions = Config::inst()->get($this->owner->ClassName, 'section_options');

        foreach ($AvailableTypes as $key => $value) {
            $Config = Config::inst();
            $selectable_option = true;
            if ($Config->get($value, 'selectable_option') !== null) {
                $selectable_option = $Config->get($value, 'selectable_option');
            }
            $AvailableTypes[$key] = array(
                'classname' => $value,
                'type' => Section::Type($value),
                'presets' => $Config->get($value, 'presets'),
                'selectable_option' => $selectable_option,
                'limit' => $Config->get($value, 'limit'),
            );

            if (isset($pageTypeOptions[$key])) {
                $AvailableTypes[$key] = array_merge($AvailableTypes[$key], $pageTypeOptions[$key]);
            }

            $AvailableTypes[$key]['limit_reached'] = false;
            if(isset($AvailableTypes[$key]['limit'])){
                if ($AvailableTypes[$key]['limit'] == 0) {
                    $AvailableTypes[$key]['limit_reached'] = true;
                }

                $CurrentSectionCount = $this->owner
                    ->Sections()
                    ->filter('ClassName', $AvailableTypes[$key]['type'])
                    ->count();
                if ($CurrentSectionCount >= $AvailableTypes[$key]['limit']) {
                    $AvailableTypes[$key]['limit_reached'] = true;
                }
            }
        }

        return $AvailableTypes;
    }
1012774
def get_output_mode(output, mode):
    
    if mode != 'auto':
        try:
            return switch_output_mode_auto[mode]
        except KeyError:
            raise ValueError('Mode "{}" is not supported.')

    extension = output.split('.')[-1]
    try:
        return switch_output_mode[extension]
    except KeyError:
        return intermediary_to_schema
965467
public function getDuration()
    {
        if (!isset($this->data['events']['__section__'])) {
            return 0;
        }

        $lastEvent = $this->data['events']['__section__'];

        return $lastEvent->getOrigin() + $lastEvent->getDuration() - $this->getStartTime();
    }
910539
public function getLastWidth($mode = false)
    {
        for ($k=count($this->table)-1; $k>=0; $k--) {
            if ($this->table[$k]['width']) {
                $w = $this->table[$k]['width'];
                if ($mode) {
                    $w+= $this->table[$k]['border']['l']['width'] + $this->table[$k]['padding']['l'] + 0.02;
                    $w+= $this->table[$k]['border']['r']['width'] + $this->table[$k]['padding']['r'] + 0.02;
                }
                return $w;
            }
        }
        return $this->_pdf->getW() - $this->_pdf->getlMargin() - $this->_pdf->getrMargin();
    }
1141308
public function checkModRewrite()
    {
        $iModStat = null;
        $aHostInfo = $this->_getShopHostInfo();
        $iModStat = $this->_checkModRewrite($aHostInfo);

        $aSSLHostInfo = $this->_getShopSSLHostInfo();
        // Don't need to check if mod status is already failed.
        if (0 != $iModStat && $aSSLHostInfo) {
            $iSSLModStat = $this->_checkModRewrite($aSSLHostInfo);

            // Send if failed, even if couldn't check another
            if (0 == $iSSLModStat) {
                return 0;
            } elseif (1 == $iSSLModStat || 1 == $iModStat) {
                return 1;
            }

            return min($iModStat, $iSSLModStat);
        }

        return $iModStat;
    }
426972
def _retrieve_output_mode(self):
        """"""
        reg_mode = re.compile(r"output\s+:\s+(?P<mode>.*)\s+\n")
        output = self.send_command("get system console")
        result_mode_re = reg_mode.search(output)
        if result_mode_re:
            result_mode = result_mode_re.group("mode").strip()
            if result_mode in ["more", "standard"]:
                self._output_mode = result_mode
1072458
public static function level()
    {
        if(defined('ZE_LEVEL_ENV')){
            return ZE_LEVEL_ENV;
        } else {
            $env = self::detect();

            switch($env){
                case 'console':
                    $level_env = 0;
                    break;
                case 'local':
                    $level_env = 1;
                    break;
                case 'dev':
                    $level_env = 2;
                    break;
                case 'demo':
                    $level_env = 3;
                    break;
                default :
                    $level_env = 4;
                    break;
            }

            define('ZE_LEVEL_ENV', $level_env);
        }

        return ZE_LEVEL_ENV;
    }
248373
protected function get_engine_config() {
		$config    = $this->prepare_engine_config();
		$locations = $config['locations'];

		unset( $config['locations'] );

		$locations = array_filter( (array) $locations, function ( $location ) {
			return file_exists( $location );
		} );

		return [$locations, $config];
	}
787494
public function getStatusText()
    {
        $statusCode = $this->getStatusCode();

        if (!isset($this->defaultStatusTextList[$statusCode])) {
            return '';
        }

        return $this->defaultStatusTextList[$statusCode];
    }
245390
private function get_sequence() {
        if (!empty($this->modinfo->sections[$this->_section])) {
            return implode(',', $this->modinfo->sections[$this->_section]);
        } else {
            return '';
        }
    }
480770
public static function current($full = false)
    {
        if (empty(static::$_current)) {
            return '';
        } elseif ($full === false) {
            return static::$_current;
        }

        return static::$_modes[static::$_current];
    }
618323
public function get_setting() {
        global $CFG;

        $value = $this->config_read($this->name);
        $flag  = $this->config_read($this->name.'_flag');

        if (is_null($value) or is_null($flag)) {
            return NULL;
        }

        $flag   = (int)$flag;
        $forced = (boolean)(1 & $flag); // first bit
        $adv    = (boolean)(2 & $flag); // second bit

        return array('value' => $value, 'forced' => $forced, 'adv' => $adv);
    }
796636
public function isEditMode()
    {
        if ($this->getCollectionPath() == STACKS_LISTING_PAGE_PATH) {
            return true;
        }
        if ($this->getPageTypeHandle() == STACKS_PAGE_TYPE) {
            return true;
        }

        return $this->isCheckedOutByMe();
    }
656000
public function getBackendDisplayMode(): string
    {
        $backendDisplayMode = $this->get('backendDisplayMode');
        $validModes = ['current', 'childs', 'both'];
        if (!\in_array($backendDisplayMode, $validModes, true)) {
            $backendDisplayMode = 'current';
        }

        return $backendDisplayMode;
    }
869146
public function runningInFallbackMode(): bool {
    $fallbackMode = false;
    $settings     = $this->getSettings();

    if (is_array($settings) && !empty($settings)) {
      $mode = $settings['mode'];

      if ($mode === self::FALLBACK_MODE) {
        $fallbackMode = true;
      }
    }

    return $fallbackMode;
  }