public function GetPath() { $path = $this->GetConfig('wp_includes.directory'); if (!BookedStringHelper::StartsWith($path, '/')) { $path = ROOT_DIR . "/{$path}"; } if (BookedStringHelper::EndsWith($path, '/')) { return $path; } return $path . '/'; }
public function __construct($name, $value, $expiration = null, $path = null) { $domain = null; if (is_null($expiration)) { $expiration = Date::Now()->AddDays(30)->TimeStamp(); } if (is_null($path)) { $path = Configuration::Instance()->GetScriptUrl(); } if (BookedStringHelper::StartsWith($path, 'http')) { $parts = parse_url($path); $path = isset($parts['path']) ? $parts['path'] : ''; } $this->Name = $name; $this->Value = $value; $this->Expiration = $expiration; // date(DATE_COOKIE, $expiration); $this->Path = $path; }
public function GetScriptUrl() { $url = $this->GetKey(ConfigKeys::SCRIPT_URL); if (BookedStringHelper::StartsWith($url, '//')) { $isHttps = ServiceLocator::GetServer()->GetIsHttps(); if ($isHttps) { $url = "https:{$url}"; } else { $url = "http:{$url}"; } } return rtrim($url, '/'); }
public function RedirectResume($url) { if (!BookedStringHelper::StartsWith($url, $this->path)) { $url = $this->path . $url; } header("Location: {$url}"); die; }
public function SetRegistrationUrl($url) { $this->Set('RegisterUrl', empty($url) ? Pages::REGISTRATION : $url); if (BookedStringHelper::StartsWith($url, 'http')) { $this->Set('RegisterUrlNew', "target='_new'"); } }
/** * @param $regex */ private function SetRegex($regex) { $this->regex = $regex; if (empty($this->regex)) { return; } if (!BookedStringHelper::StartsWith($this->regex, '/')) { $this->regex = '/' . $this->regex; } if (!BookedStringHelper::EndsWith($this->regex, '/')) { $this->regex = $this->regex . '/'; } }
public function PrintLink($params, &$smarty) { $string = $this->Resources->GetString($params['key']); if (!isset($params['title'])) { $title = $string; } else { $title = $this->Resources->GetString($params['title']); } if (BookedStringHelper::StartsWith($params['href'], '/')) { $href = $params['href']; } else { $href = $this->RootPath . $params['href']; } $knownAttributes = array('key', 'title', 'href'); $attributes = $this->AppendAttributes($params, $knownAttributes); return "<a href=\"{$href}\" title=\"{$title}\" {$attributes}>{$string}</a>"; }
public function GetRow($row) { $attributes = null; if (array_key_exists(ColumnNames::ATTRIBUTE_LIST, $row)) { $attributes = CustomAttributes::Parse($row[ColumnNames::ATTRIBUTE_LIST]); } $formattedRow = array(); foreach ($this->columns as $key => $column) { if ($key == ColumnNames::TOTAL || $key == ColumnNames::TOTAL_TIME) { $this->sum += $row[$key]; $this->sumColumn = $column; } if ($attributes != null && BookedStringHelper::StartsWith($key, 'attribute')) { $id = intval(str_replace('attribute', '', $key)); $attribute = $attributes->Get($id); $formattedRow[] = new ReportAttributeCell($column->GetData($attribute)); } else { $formattedRow[] = new ReportCell($column->GetData($row[$key]), $column->GetChartData($row, $key), $column->GetChartColumnType(), $column->GetChartGroup()); } } return $formattedRow; }
private function AddCustomAttributes($category, CustomAttributes $attributes, &$formattedRow, $key, ReportColumn $column) { $prefix = $category . 'attribute'; if ($attributes != null && BookedStringHelper::StartsWith($key, $prefix)) { $id = intval(str_replace($prefix, '', $key)); $attribute = $attributes->Get($id); $formattedRow[] = new ReportAttributeCell($column->GetData($attribute)); } }