コード例 #1
0
ファイル: WordPressOptions.php プロジェクト: Trideon/gigolo
 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 . '/';
 }
コード例 #2
0
ファイル: Cookie.php プロジェクト: JoseTfg/Booked
 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;
 }
コード例 #3
0
ファイル: Configuration.php プロジェクト: hugutux/booked
 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, '/');
 }
コード例 #4
0
ファイル: Page.php プロジェクト: Trideon/gigolo
 public function RedirectResume($url)
 {
     if (!BookedStringHelper::StartsWith($url, $this->path)) {
         $url = $this->path . $url;
     }
     header("Location: {$url}");
     die;
 }
コード例 #5
0
ファイル: LoginPage.php プロジェクト: JoseTfg/Booked
 public function SetRegistrationUrl($url)
 {
     $this->Set('RegisterUrl', empty($url) ? Pages::REGISTRATION : $url);
     if (BookedStringHelper::StartsWith($url, 'http')) {
         $this->Set('RegisterUrlNew', "target='_new'");
     }
 }
コード例 #6
0
ファイル: CustomAttribute.php プロジェクト: JoseTfg/Booked
 /**
  * @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 . '/';
     }
 }
コード例 #7
0
ファイル: SmartyPage.php プロジェクト: Trideon/gigolo
 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>";
 }
コード例 #8
0
ファイル: ReportDefinition.php プロジェクト: Trideon/gigolo
 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;
 }
コード例 #9
0
 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));
     }
 }