예제 #1
0
 public function onLoad($param)
 {
     $this->title = '';
     $this->keywords = '';
     $this->description = '';
     $baseMethod = new BaseFunction();
     $langID = $baseMethod->getShortLang();
     $this->LangCode = $baseMethod->getShortLang();
     switch ($this->getPage()->getPagePath()) {
         case 'Home':
             $seo = PagesRecord::finder()->findByID_AND_LangCode(1, $langID);
             $this->title = $seo->Name;
             $this->keywords = $seo->MetaKeywords;
             $this->description = $seo->MetaDescription;
             break;
         case 'Pages':
             $seo = PagesRecord::finder()->findByID_AND_LangCode($this->getRequest()->itemAt("id"), $langID);
             $this->title = $seo->Name;
             $this->keywords = $seo->MetaKeywords;
             $this->description = $seo->MetaDescription;
             break;
         default:
             break;
     }
     $phrase = SettingsRecord::finder()->findAllByLanguageID(1);
     foreach ($phrase as $key => $value) {
         $this->StaticPhrase[$value->Key] = $value->Value;
     }
     $this->Footer->DataSource = PagesRecord::finder()->findAll('ShowFooter = 1 ORDER BY Position ');
     $this->Footer->dataBind();
 }
예제 #2
0
파일: Twitter.php 프로젝트: ivphpan/iris
 public function summary()
 {
     $data = [];
     foreach ($this->fields() as $key) {
         $data[] = ['name' => 'twitter:' . $key, 'content' => SettingsRecord::get($this->category, $key)];
     }
     return $data;
 }
예제 #3
0
 public function deleteItem($sender, $param)
 {
     if ($this->Language->DataKeys[$param->Item->ItemIndex] == 1) {
         echo 'Error : nie można usunąć domyslnego języka';
         die;
     } else {
         PagesRecord::finder()->deleteAllByLanguageID($this->Language->DataKeys[$param->Item->ItemIndex]);
         SettingsRecord::finder()->deleteAllByLanguageID($this->Language->DataKeys[$param->Item->ItemIndex]);
         LanguageRecord::finder()->deleteByPk($this->Language->DataKeys[$param->Item->ItemIndex]);
         $this->Response->redirect($this->Service->constructUrl("Language.Index", array('id' => 1)));
     }
 }
예제 #4
0
 public function deleteItem($sender, $param)
 {
     if ($this->Language->DataKeys[$param->Item->ItemIndex] == 1) {
         echo 'Error : nie można usunąć domyslnego języka';
         die;
     } else {
         PagesRecord::finder()->deleteAllByLanguageID($this->Language->DataKeys[$param->Item->ItemIndex]);
         SettingsRecord::finder()->deleteAllByLanguageID($this->Language->DataKeys[$param->Item->ItemIndex]);
         TransUnitRecord::finder()->deleteAllBycat_id($this->Language->DataKeys[$param->Item->ItemIndex]);
         CatalogueRecord::finder()->deleteBycat_id($this->Language->DataKeys[$param->Item->ItemIndex]);
         $session = Prado::getApplication()->getSession();
         $session->add('jezyk', 1);
         $this->Response->redirect($this->Service->constructUrl("Home"));
     }
 }
예제 #5
0
 public function saveItem($sender, $param)
 {
     $session = Prado::getApplication()->getSession();
     $langID = $session->itemAt('jezyk');
     $id = $param->Item->ItemIndex + 1;
     $item = $param->Item;
     $rows = SettingsRecord::finder()->find('ID = ? AND LanguageID = ?', $id, $langID);
     $rows->Value = $item->Value->TextBox->Text;
     $rows->save();
     $this->DataGrid->EditItemIndex = -1;
     $this->DataGrid->DataSource = $this->Data;
     $this->DataGrid->dataBind();
     $session = Prado::getApplication()->getSession();
     $langID = $session->itemAt('jezyk');
     $this->Response->redirect($this->Service->constructUrl("Settings.Index", array('id' => $langID)));
 }
예제 #6
0
파일: GooglePlus.php 프로젝트: ivphpan/iris
 public function summary()
 {
     return [['itemprop' => 'name', 'content' => SettingsRecord::get($this->category, 'name')], ['itemprop' => 'description', 'content' => SettingsRecord::get($this->category, 'description')]];
 }
예제 #7
0
파일: Address.php 프로젝트: ivphpan/iris
 public function summary()
 {
     return [['property' => 'place:location:latitude', 'content' => SettingsRecord::get($this->category, 'latitude')], ['property' => 'place:location:longitude', 'content' => SettingsRecord::get($this->category, 'longitude')], ['property' => 'business:contact_data:street_address', 'content' => SettingsRecord::get($this->category, 'streetAddress')], ['property' => 'business:contact_data:street_address', 'content' => SettingsRecord::get($this->category, 'locality')], ['property' => 'business:contact_data:country_name', 'content' => SettingsRecord::get($this->category, 'countryName')], ['property' => 'business:contact_data:email', 'content' => SettingsRecord::get($this->category, 'email')], ['property' => 'business:contact_data:phone_number', 'content' => SettingsRecord::get($this->category, 'phoneNumber')], ['property' => 'business:contact_data:website', 'content' => SettingsRecord::get($this->category, 'website')]];
 }