private function AddErrorUrlElement()
 {
     $name = 'ErrorUrl';
     $this->selectorError = new PageUrlSelector($name, Trans($this->Label($name)), $this->confirm->GetErrorUrl());
     //$this->selectorError ->SetRequired($this->ErrorPrefix($name));
     $this->Elements()->AddElement($name, $this->selectorError);
 }
 /**
  * Adds the field for name field label
  */
 private function AddNextUrlField()
 {
     $name = 'NextUrl';
     $this->selectorNext = new PageUrlSelector($name, Trans($this->Label($name)), $this->register->GetNextUrl());
     $this->selectorNext->SetRequired($this->ErrorPrefix($name));
     $this->Elements()->AddElement($name, $this->selectorNext);
 }
Esempio n. 3
0
 /**
  * Creates the new field columnizer
  * @param BackendForm $form The form where the fields are added
  * @param int $maxColumns The maximum amount of allowed columns
  * @throws \Exception Raises an error in case the max Columns doesn't match the 12 columns grid
  */
 function __construct(BackendForm $form, $maxColumns = 4)
 {
     $this->form = $form;
     if (12 % $maxColumns != 0) {
         throw new \Exception(Trans('Core.FieldColumnizer.Error.MaxColumns.MustDivide12'));
     }
     $this->maxColumns = (int) $maxColumns;
     $this->fields = array();
 }
Esempio n. 4
0
 /**
  * Renders a specific checkbox
  * @param string $name
  * @return string
  */
 protected function RenderCheckbox($name)
 {
     $checkbox = new Checkbox($this->namePrefix . $name);
     $class = new \ReflectionClass($this);
     $checkbox->SetLabel(Trans('Core.' . $class->getShortName() . '.' . $name));
     if ($this->Value($name)) {
         $checkbox->SetChecked();
     }
     $field = new CheckboxField($checkbox);
     return $field->Render();
 }
Esempio n. 5
0
 private function HandleLoggedIn()
 {
     $nextUrl = $this->login->GetNextUrl();
     if (!self::Guard()->Accessor()->IsUndefined()) {
         if ($nextUrl) {
             Response::Redirect($nextUrl);
         } else {
             throw new \Exception(Trans('BuiltIn.Login.Exception.AlreadyLoggedIn'));
         }
     }
 }
Esempio n. 6
0
 /**
  * Adds the user group field
  */
 private function AddUserGroupField()
 {
     $name = 'UserGroup';
     $field = new Select($name, '');
     $field->AddOption('', Trans('Core.ContainerForm.NoGroup'));
     if ($this->container->Exists() && $this->container->GetUserGroup()) {
         $field->SetValue($this->container->GetUserGroup()->GetID());
     }
     DBSelectUtil::AddUserGroupOptions($field);
     $this->AddField($field);
 }
Esempio n. 7
0
 private function AddTagNameField()
 {
     $name = 'TagName';
     $select = new Select($name, $this->block->GetTagName());
     $select->AddOption('', Trans('Core.PleaseSelect'));
     $values = BlockTag::AllowedValues();
     foreach ($values as $value) {
         $select->AddOption($value, $value);
     }
     $this->AddField($select);
     $this->SetRequired($name);
 }
Esempio n. 8
0
 private function AddLanguageField()
 {
     $name = 'Language';
     $lang = $this->user->GetLanguage();
     $field = new Select($name, $lang ? $lang->GetID() : '');
     $field->AddOption('', Trans('Core.PleaseSelect'));
     $sql = Access::SqlBuilder();
     $tbl = Language::Schema()->Table();
     $where = $sql->Equals($tbl->Field('IsBackendTranslated'), $sql->Value(true));
     DBSelectUtil::AddLanguageOptions($field, $where);
     $this->AddField($field);
     $this->SetRequired($name);
 }
Esempio n. 9
0
 private function AddContainerField()
 {
     $name = 'Container';
     $value = $this->container->Exists() ? $this->container->GetContainer()->GetID() : '';
     $select = new Select($name, $value);
     $select->AddOption('', Trans('Core.PleaseSelect'));
     $sql = Access::SqlBuilder();
     $tblContainer = Container::Schema()->Table();
     $orderBy = $sql->OrderList($sql->OrderAsc($tblContainer->Field('Name')));
     $containers = Container::Schema()->Fetch(false, null, $orderBy);
     foreach ($containers as $container) {
         $select->AddOption($container->GetID(), $container->GetName());
     }
     $this->AddField($select);
     $this->SetRequired($name);
 }
Esempio n. 10
0
 private function performAction()
 {
     switch (Request::PostData('action')) {
         case 'insertIn':
             $this->InsertIn();
             break;
         case 'insertAfter':
             $this->InsertAfter();
             break;
         case 'delete':
             $this->BeforeDelete();
             $this->Delete();
             break;
         default:
             $this->AttachError(Trans('Core.JsonTree.Error.UndefinedAction'));
     }
 }
Esempio n. 11
0
 /**
  * Adds the module type option, if allowed
  * @param Select $select The select box
  * @param string $type The module type
  */
 private function AddModuleTypeOption(Select $select, $type)
 {
     if ($type != 'BuiltIn-Container' || !Request::GetData('container') && Container::Schema()->Count() > 0) {
         $select->AddOption($type, Trans($type));
     }
 }
Esempio n. 12
0
 private function ApplyFilters(array $filters, $value)
 {
     $isRaw = false;
     foreach ($filters as $filter) {
         if ($filter == 'raw') {
             $isRaw = true;
             continue;
         }
         if (!function_exists($filter)) {
             throw new \Exception(Trans('Core.Replacer.Error.FilterNotFound.Name_{0}', $filter));
         }
         $value = $filter($value);
     }
     return $isRaw ? $value : Html($value);
 }
Esempio n. 13
0
 private function UnsetPage()
 {
     $this->SetJSFieldValue('#' . $this->prefix . 'Page', '');
     if (!$this->pageOnly) {
         $this->SetJSFieldValue('#' . $this->prefix . 'Params', '');
         $this->SetJSFieldValue('#' . $this->prefix . 'Fragment', '');
         $this->SetJSHtml('#' . $this->prefix . 'Url', Trans('Core.PageUrlSelector.NoPage'));
     } else {
         $this->SetJSHtml('#' . $this->prefix . 'Name', Trans('Core.PageSelector.NoPage'));
     }
 }
Esempio n. 14
0
 /**
  * Gets a display name for backend issues, can be overridden
  * @return string The display name
  */
 public function BackendName()
 {
     if ($this->ContentForm()) {
         $this->ContentForm()->ReadTranslations();
     }
     return Trans($this->MyBundle() . '.' . $this->MyName() . '.BackendName');
 }
Esempio n. 15
0
 protected function RenderWordingFields($noFieldset = false)
 {
     $result = '';
     $wordings = $this->Wordings();
     if (count($wordings) == 0) {
         return $result;
     }
     if (!$noFieldset) {
         $legend = Html(Trans('Core.ContentForm.Legend.Wordings'));
         $result .= "<fieldset><legend>{$legend}</legend>";
     }
     $result .= '<div id="wording-table">';
     foreach ($this->Wordings() as $name) {
         $result .= '<div class="wording-row">';
         $result .= $this->RenderElement($this->WordingFieldName($name));
         $result .= '</div>';
     }
     $result .= '</div>';
     if (!$noFieldset) {
         $result .= '</fieldset>';
     }
     return $result;
 }
Esempio n. 16
0
 /**
  * The name of the cache file
  * @param FrontendModule $module
  * @return string The name of the cache file, it needn't exist yet
  * @throws \Exception Raises an error in case the cache key is not alphanumeric
  */
 static function ContentCacheFile(FrontendModule $module)
 {
     $file = $module->Content()->GetID();
     $cacheKey = $module->CacheKey();
     if ($cacheKey) {
         if (!ctype_alnum($cacheKey)) {
             throw new \Exception(Trans('Core.CacheKey.Error.NotAlphaNumeric'));
         }
         $file .= '-' . $cacheKey;
     }
     $cacheFolder = Path::Combine(PHINE_PATH, 'Cache/Content');
     return Path::AddExtension(Path::Combine($cacheFolder, $file), 'phtml');
 }
Esempio n. 17
0
function checkbackto($do_jump, $msg = '')
{
    if ($msg == '') {
        $msg = Trans('Continue');
    }
    $backto = Post('backto');
    if ($backto == '') {
        $backto = Get('backto');
    }
    if ($backto != '') {
        if ($do_jump) {
            echo oria_jumpto($backto, $msg);
        } else {
            echo oria_butlink($msg, $backto);
        }
    }
}
Esempio n. 18
0
 private function AddNextUrlField()
 {
     $name = 'NextUrl';
     $this->selectorNext = new PageUrlSelector($name, Trans($this->Label($name)), $this->login->GetNextUrl());
     $this->Elements()->AddElement($name, $this->selectorNext);
 }
Esempio n. 19
0
 private function AddRedirectTargetSelector()
 {
     $name = 'RedirectTarget';
     $this->selector = new PageUrlSelector($name, Trans($this->Label($name)), $this->page->GetRedirectTarget());
     if ($this->page->Exists()) {
         $this->selector->DisablePage($this->page);
     }
     if ($this->Value('Type') == (string) PageType::RedirectPermanent() || $this->Value('Type') == (string) PageType::RedirectTemporary()) {
         $this->selector->SetRequired($this->ErrorPrefix($name));
     }
     $this->Elements()->AddElement($name, $this->selector);
 }
 private function AddTypeField()
 {
     $name = 'Type';
     $value = 'PageItem';
     if ($this->naviItem->Exists() && $this->naviItem->GetUrlItem()) {
         $value = 'UrlItem';
     }
     $field = new Select($name, $value);
     $field->AddOption('PageItem', Trans('BuiltIn.NavigationItem.Type.PageItem'));
     $field->AddOption('UrlItem', Trans('BuiltIn.NavigationItem.Type.UrlItem'));
     $this->AddField($field);
 }
Esempio n. 21
0
 /**
  * Adds the smtp security field
  */
 private function AddSmtpSecurityField()
 {
     $name = 'SmtpSecurity';
     $field = new Select($name, $this->settings->GetSmtpSecurity());
     $values = SmtpSecurity::AllowedValues();
     foreach ($values as $value) {
         $field->AddOption($value, Trans("Core.SettingsForm.SmtpSecurity.{$value}"));
     }
     $this->AddField($field);
 }
Esempio n. 22
0
 /**
  * The bundle description
  */
 final function Description()
 {
     return Trans(self::BundleName() . '.Manifest.Description');
 }
Esempio n. 23
0
 /**
  * Gets the element with the given name
  * @param string $name
  * @return IFormElement
  */
 public function GetElement($name)
 {
     $element = $this->Elements()->GetElement($name);
     if (!$element) {
         throw new \Exception(Trans('Core.Form.Error.ElementNotFound.Name_{0}', $name));
     }
     return $element;
 }
Esempio n. 24
0
    $Money = $info['Money'];
    $Status = $info['Status'];
    $Attack = $info['Attack'];
    $Defense = $info['Defense'];
    $Hit = $info['Hit'];
    $Miss = $info['Miss'];
    $Move = $info['Move'];
    $MagicAttack = $info['MagicAttack'];
    $MagicDefense = $info['MagicDefense'];
    $Health = $info['Health'];
    $MaxHealth = $info['MaxHealth'];
    $Strength = Trans($Strength);
    $Agility = Trans($Agility);
    $Endurance = Trans($Endurance);
    $Magic = Trans($Magic);
    $TrumpAbility = Trans($TrumpAbility);
    $result = mysql_query("SELECT Title FROM achievementset WHERE id='{$TitleId}'");
    $info2 = mysql_fetch_array($result);
    $Title = $info2[0];
    echo '<p class=role>';
    echo $Title . '&nbsp&nbsp&nbsp' . $nam . '<br />经验:' . $Exp . '&nbsp&nbsp&nbsp等级:' . $Level . '&nbsp&nbsp&nbsp金钱:' . $Money . '&nbsp&nbsp&nbsp状态:' . $Status . '<br />';
    echo '力量:' . $Strength . '&nbsp&nbsp&nbsp敏捷:' . $Agility . '&nbsp&nbsp&nbsp耐力:' . $Endurance . '&nbsp&nbsp&nbsp魔力:' . $Magic . '&nbsp&nbsp&nbsp宝具:' . $TrumpAbility . '<br />';
    echo '攻击:' . $Attack . '&nbsp&nbsp&nbsp防御:' . $Defense . '&nbsp&nbsp&nbsp命中:' . $Hit . '&nbsp&nbsp&nbsp回避:' . $Miss . '&nbsp&nbsp&nbsp移动:' . $Move . '&nbsp&nbsp&nbsp属性攻击:' . $MagicAttack . '&nbsp&nbsp&nbsp属性防御:' . $MagicDefense . '<br />';
    echo '生命值:' . $Health . '/' . $MaxHealth . '</p>';
}
function Trans($number)
{
    switch ($number) {
        case 0:
            return 'F';
        case 1:
Esempio n. 25
0
    if ($active) {
        echo "<span style='color:green'>" . FA::icon('toggle-on')->x2();
    } else {
        echo "<span style='color:gray'>" . FA::icon('toggle-off')->x2();
    }
    echo "</span>";
});
Html::macro('featured', function ($active) {
    echo "<span style='color:black'>";
    if ($active) {
        echo FA::icon('star');
    } else {
        echo FA::icon('star-o');
    }
    echo "</span>";
});
Html::macro('loadingImage', function () {
    echo "<span class='loadingImage'>";
    echo FA::spin('circle-o-notch');
    echo "</span>";
});
Html::macro('saveButton', function ($text = null) {
    echo "<button type=\"submit\" class=\"button\" onclick=\"\$(this).css('width','+=15');\">";
    echo Html::loadingImage() . " ";
    if ($text == null) {
        echo Trans('admin.save');
    } else {
        echo $text;
    }
    echo "</button>";
});