Decorate message

@param string                       $value
@param Aoe_Scheduler_Model_Schedule $row

@return string
509794
public function decorateMessages($value, Aoe_Scheduler_Model_Schedule $row)
    {
        $return = '';
        if (!empty($value)) {
            $return .= '<a href="#" onclick="$(\'messages_' . $row->getScheduleId() . '\').toggle(); return false;">' . $this->__('Message') . '</a>';
            $return .= '<div class="schedule-message" id="messages_' . $row->getScheduleId() . '" style="display: none; width: 300px; overflow: auto; font-size: small;"><pre>' . $value . '</pre></div>';
        }
        return $return;
    }
573054
public static function getClass($values)
    {
        if (false == isset($values['instance'])) {
            throw new SchedulerException('Values has no "instance" field');
        }

        switch ($values['instance']) {
            // triggers
            case SimpleTrigger::INSTANCE:
                return SimpleTrigger::class;
            case CronTrigger::INSTANCE:
                return CronTrigger::class;
            case CalendarIntervalTrigger::INSTANCE:
                return CalendarIntervalTrigger::class;
            case DailyTimeIntervalTrigger::INSTANCE:
                return DailyTimeIntervalTrigger::class;
            // job
            case JobDetail::INSTANCE:
                return JobDetail::class;
            // calendars
            case HolidayCalendar::INSTANCE:
                return HolidayCalendar::class;
            case WeeklyCalendar::INSTANCE:
                return WeeklyCalendar::class;
            case MonthlyCalendar::INSTANCE:
                return MonthlyCalendar::class;
            case CronCalendar::INSTANCE:
                return CronCalendar::class;
            case DailyCalendar::INSTANCE:
                return DailyCalendar::class;
            // key
            case Key::INSTANCE:
                return Key::class;
            default:
                throw new SchedulerException(sprintf('Unknown values instance: "%s"', $values['instance']));
        }
    }
71612
public function setId(int $value) : ScheduledJob
    {

        if ($this->data['id'] !== $value) {
            $this->data['id'] = $value;
            $this->setModified('id');
        }

        return $this;
    }
759657
private function serialize($value) : string
    {
        if ($this->packer !== null) {
            $value = $this->packer->pack($value);
        }

        return serialize($value);
    }
962726
protected function wrap($value, $expire)
    {
        $expire = $this->normalizeTime($expire);

        return $expire."\n".serialize($value);
    }
638411
protected function getCellValue(Model $row, $decorator)
    {
        if ($decorator !== null) {
            return $decorator[$this->columnName];
        } else {
            return $row[$this->columnName];
        }
    }
826592
public function setMinRow($value)
    {
        if ($value != null) {
            $this->_params['min-row'] = $value;
        } else {
            unset($this->_params['min-row']);
        }
        return $this;
    }
165871
public function format($row)
    {
        $data = $this->getArray($row);
        $data = $this->process($data);

        return json_encode($data, $this->encodeOptions);
    }
158825
private function runCallback(array $row, string $value, string $key = '')
    {
        // Callback for all data
        foreach ($this->callback_values as $function) {
            if (\is_string($function) && substr_count($function, '::') === 1) {
                $value = \call_user_func(explode('::', $function), $value, $key);
            } elseif (\is_array($function)) {
                if (\count($function) === 2) {
                    $value = $function($value);
                }
            } else {
                $value = $function($value);
            }
        }

        // Callback for one row
        foreach ($this->callbacks_for_row as $function) {
            if (\is_string($function) && substr_count($function, '::') === 1) {
                $value = \call_user_func(explode('::', $function), $value, $row, $key);
            } else {
                $value = $function($value, $row);
            }
        }

        return $value;
    }
590300
protected function wrapValue($value)
    {
        if ($this->isReserved($value)) {
            return Str::upper(parent::wrapValue($value));
        }

        return $value !== '*' ? sprintf($this->wrapper, $value) : $value;
    }
549432
public function format($row, $model) {
        foreach ($row as $fieldname=>$value) {
                $row[$fieldname] = $this->_format($fieldname, $row[$fieldname], $model);
        }
        return $row;
    }
43746
private function prepareColumnValues($tableName, $row)
    {
        $ret = array();
        $columnTypes = $this->tableColumnTypes[$tableName];
        foreach ($row as $colName => $colValue) {
            $colValue = $this->hookTransformColumnValue($tableName, $colName, $colValue, $row);
            $ret[] = $this->escape($colValue, $columnTypes[$colName]);
        }

        return $ret;
    }
357993
public function render(Row $row)
	{
		/**
		 * Renderer function may be used
		 */
		try {
			return $this->useRenderer($row);
		} catch (DataGridColumnRendererException $e) {
			/**
			 * Do not use renderer
			 */
		}

		$value = parent::render($row);

		if (!$value && !$this->icon) {
			return null;
		}

		$a = Html::el('a')
			->href($this->createLink(
				$this->grid,
				$this->href,
				$this->getItemParams($row, $this->params) + $this->parameters
			));

		if (!empty($this->data_attributes)) {
			foreach ($this->data_attributes as $key => $attr_value) {
				$a->data($key, $attr_value);
			}
		}

		if ($this->open_in_new_tab) {
			$a->addAttributes(['target' => '_blank']);
		}

		if ($this->title) {
			$a->title($this->title);
		}
		if ($this->class) {
			$a->class($this->class);
		}

		$element = $a;

		if ($this->icon) {
			$a->addHtml(Html::el('span')->class(DataGrid::$icon_prefix . $this->icon));

			if (strlen($value)) {
				$a->addHtml('&nbsp;');
			}
		}

		if ($this->isTemplateEscaped()) {
			$a->addText($value);
		} else {
			$a->addHtml($value);
		}

		return $element;
	}
172178
protected function renderDataCellContent($row, $data)
    {
        /* @var $am CAuthManager|AuthBehavior */
        $am = Yii::app()->getAuthManager();

        $linkCssClass = $this->active || $am->hasParent($this->itemName, $data['name']) || $am->hasChild(
            $this->itemName,
            $data['name']
        ) ? 'active' : 'disabled';

        /* @var $controller AuthItemController */
        $controller = $this->grid->getController();

        echo CHtml::link(
            $data['item']->description,
            array('/auth/' . $controller->getItemControllerId($data['item']->type) . '/view', 'name' => $data['name']),
            array('class' => $linkCssClass)
        );
    }
1006991
public function setMessage(?string $value) : Job
    {

        if ($this->data['message'] !== $value) {
            $this->data['message'] = $value;
            $this->setModified('message');
        }

        return $this;
    }
591359
public function setCurrentJob($value) : ScheduledJob
    {
        // Is this a scalar value representing the ID of this foreign key?
        if (is_scalar($value)) {
            return $this->setCurrentJobId($value);
        }

        // Is this an instance of CurrentJob?
        if (is_object($value) && $value instanceof Job) {
            return $this->setCurrentJobObject($value);
        }

        // Is this an array representing a Job item?
        if (is_array($value) && !empty($value['id'])) {
            return $this->setCurrentJobId($value['id']);
        }

        // None of the above? That's a problem!
        throw new \Exception('Invalid value for CurrentJob.');
    }
641468
private function getCellXml(array $row, Style $style)
    {
        $cellXml = '';
        foreach (array_values($row) as $cellIndex => $cellValue) {
            $this->updateColumnWidths($cellValue, $cellIndex, $style->getFont());
            $cellXml .= $this->cellBuilder->build(
                $this->rowIndex, $cellIndex, $cellValue, $style->getId()
            );
        }

        return $cellXml;
    }