function display_tracks($album_id) { global $track_fields; // $a is an accumulator for the output string $a = subheading('Tracks'); $a .= "<table class=\"results\">\n"; // head of table $a .= "<tr>"; // table row for headings foreach ($track_fields as $name) { $name = display_name($name); // uppercase the first char $a .= "<td class=\"column_head\">{$name}</td>\n"; } // space for the links at the right side of the results table $a .= "<td class=\"column_head\">Action</td>\n"; $a .= new_track($album_id); $sth = get_tracks_sql($album_id); $row_count = 0; while ($row = $sth->fetch(PDO::FETCH_ASSOC)) { $a .= track_result_row($row); $row_count++; } $a .= "</table>\n"; content($a); }
<?php if (!defined('APPLICATION')) { exit; } echo heading(t($this->data('Title'))); ?> <section> <?php echo subheading(t('Flagging Settings')); echo $this->Form->open(); echo $this->Form->errors(); ?> <ul> <li class="form-group"> <?php echo $this->Form->labelWrap('Category to Use', 'Plugins.Flagging.CategoryID'); ?> <div class="input-wrap"> <?php echo $this->Form->CategoryDropDown('Plugins.Flagging.CategoryID', array('Value' => c('Plugins.Flagging.CategoryID'))); ?> </div> </li> <li class="form-group"> <div class="input-wrap no-label"> <?php echo $this->Form->checkBox('Plugins.Flagging.UseDiscussions', t('Create Discussions')); ?> </div> </li>
?> </div> <?php if (Gdn::addonManager()->isEnabled('Vanilla', \Vanilla\Addon::TYPE_ADDON)) { ?> <?php echo subheading(t('Discussions Layout'), t('Choose the preferred layout for the discussions page.')); ?> <div class="LayoutOptions DiscussionsLayout label-selector"> <?php echo WriteHomepageOption('Modern Layout', 'modern', 'disc-modern', $CurrentDiscussionLayout, t('Modern non-table-based layout')); echo WriteHomepageOption('Table Layout', 'table', 'disc-table', $CurrentDiscussionLayout, t('Classic table layout used by traditional forums')); ?> </div> <?php echo subheading(t('Categories Layout'), t('Choose the preferred layout for the categories page.')); ?> <div class="LayoutOptions CategoriesLayout label-selector"> <?php echo WriteHomepageOption('Modern Layout', 'modern', 'cat-modern', $CurrentCategoriesLayout, t('Modern non-table-based layout')); echo WriteHomepageOption('Table Layout', 'table', 'cat-table', $CurrentCategoriesLayout, t('Classic table layout used by traditional forums')); echo WriteHomepageOption('Mixed Layout', 'mixed', 'cat-mixed', $CurrentCategoriesLayout, t('All categories listed with a selection of 5 recent discussions under each')); ?> </div> <?php } ?> </div> <?php echo $this->Form->open();
</body> tag.</div> <div class="input-wrap-right"> <button class="btn btn-secondary btn-copy" data-clipboard-target="#comments-count-code" data-success-text="<?php echo t('Copied!'); ?> "> <?php echo t('Copy Embed Code to Clipboard'); ?> </button> </div> </div> </section> <section> <?php echo subheading(t('One more thing!')); ?> <div class="padded">You need to tell Vanilla where the comment counts are located in your page. To achieve this, add a <strong>vanilla-identifier</strong> attribute to the anchor linking to the comments. The vanilla-identifier is the same value used above when embedding the comments into the page.</div> <pre id="anchor-code" class="CopyBox"><a href="http://yourdomain.com/path/to/page/with/comments/#vanilla_comments" <strong>vanilla-identifier="embed-test"</strong>>Comments</a> </pre> <div class="row form-group"> <div class="info label-wrap-wide">Vanilla will then replace the content of the anchor (in this case, the word "Comments") with the number of comments on the page in question.</div> <div class="input-wrap-right"> <button class="btn btn-secondary btn-copy" data-clipboard-target="#anchor-code" data-success-text="<?php echo t('Copied!'); ?> "> <?php
<div class="label-wrap"> <?php echo $this->Form->label('Email', 'Email'); ?> <?php echo wrap(t('Garden.Import.InputInstructions', 'Enter the email of the admin user from the data being imported. Your current password will become this user\'s password.'), 'div', ['class' => 'info']); ?> </div> <?php echo $this->Form->textBoxWrap('Email'); ?> </li> </ul> <section> <?php echo subheading(t('Advanced Options')); ?> <ul> <li class="form-group"> <?php echo $this->Form->labelWrap('Generate import SQL only', 'GenerateSQL'); ?> <div class="input-wrap"> <?php echo $this->Form->CheckBox('GenerateSQL'); ?> </div> </li> </ul> </section> <?php
} ?> <div class="options padded-top flex"> <?php echo anchor(t('Remove'), '/dashboard/settings/removedefaultavatar/', $disabled . 'btn btn-primary js-hijack js-modal-confirm remove-avatar'); ?> <?php echo anchor(t('Change'), '/dashboard/settings/defaultavatar', 'btn btn-primary change-avatar'); ?> </div> </div> </div> <div class="avatar-advanced"> <section> <?php echo subheading(t('Avatar Settings'), t('Change the sizes that avatar images are saved at.') . ' ' . t('Changes will apply to newly uploaded avatars only.')); echo $this->Form->open(array('enctype' => 'multipart/form-data')); echo $this->Form->errors(); ?> <ul> <li class="form-group"> <div class="label-wrap-wide"> <?php echo $this->Form->label('Thumbnail Size', 'Garden.Thumbnail.Size'); echo wrap(t('Avatars will have their thumbnails saved at this size.'), 'div', array('class' => 'info')); ?> </div> <div class="input-wrap-right"> <div class="textbox-suffix" data-suffix="<?php echo t('px'); ?>
echo $this->Form->checkBox('PersonalInfo', t('RolePersonalInfo', "This role is personal info. Only users with permission to view personal info will see it."), ['value' => '1']); ?> </div> </li> <?php $this->fireEvent('BeforeRolePermissions'); echo $this->Form->simple($this->data('_ExtendedFields', []), ['Wrap' => ['', '']]); ?> </ul> <?php if (count($this->PermissionData) > 0) { ?> <section> <?php echo subheading(t('Check all permissions that apply to this role:')); if ($this->Role && $this->Role->CanSession != '1') { ?> <div class="alert alert-warning padded"><?php echo t('Heads Up! This is a special role that does not allow active sessions. For this reason, the permission options have been limited to "view" permissions.'); ?> </div> <?php } ?> <div class="RolePermissions"> <?php echo $this->Form->checkBoxGridGroups($this->PermissionData, 'Permission'); ?> </div> </section>
</div> </li> <li class="form-group"> <div class="label-wrap"> <div class="label">Redirect Users</div> <div class="info"> <strong>Recommended:</strong> When there is more than one page of comments on a blog post, send users to the forum when they click to see another page of comments. This is a great way of driving users into your community. </div> </div> <div class="input-wrap"> <?php echo $this->Form->CheckBox('Garden.Embed.PageToForum', "Send users to forum after the first page of comments."); ?> </div> </li> </ul> </section> <section> <?php echo subheading(t('Sign In Settings')); ?> <div class="form-group"> <?php echo $this->Form->toggle('Garden.SignIn.Popup', 'Enable popups for sign in pages.', [], 'If you are using SSO, you probably want to leave this disabled'); ?> </div> </section> <?php echo $this->Form->close('Save');
/** * * * @param SettingsController $sender * @param array $Args */ protected function settings_addEdit($sender, $Args) { $sender->addJsFile('jsconnect-settings.js', 'plugins/jsconnect'); $client_id = $sender->Request->get('client_id'); Gdn::locale()->setTranslation('AuthenticationKey', 'Client ID'); Gdn::locale()->setTranslation('AssociationSecret', 'Secret'); Gdn::locale()->setTranslation('AuthenticateUrl', 'Authentication Url'); /* @var Gdn_Form $form */ $form = $sender->Form; $model = new Gdn_AuthenticationProviderModel(); $form->setModel($model); $generate = false; if ($form->authenticatedPostBack()) { if ($form->getFormValue('Generate') || $sender->Request->post('Generate')) { $generate = true; $key = mt_rand(); $secret = md5(mt_rand()); $sender->setFormSaved(false); } else { $form->validateRule('AuthenticationKey', 'ValidateRequired'); $form->validateRule('AuthenticationKey', 'regex:`^[a-z0-9_-]+$`i', T('The client id must contain only letters, numbers and dashes.')); $form->validateRule('AssociationSecret', 'ValidateRequired'); $form->validateRule('AuthenticateUrl', 'ValidateRequired'); $form->setFormValue('AuthenticationSchemeAlias', 'jsconnect'); if ($form->save(['ID' => $client_id])) { $sender->RedirectUrl = url('/settings/jsconnect'); } } } else { if ($client_id) { $provider = self::getProvider($client_id); touchValue('Trusted', $provider, 1); } else { $provider = array(); } $form->setData($provider); } // Set up the form controls for editing the connection. $hashTypes = hash_algos(); $hashTypes = array_combine($hashTypes, $hashTypes); $controls = ['AuthenticationKey' => ['LabelCode' => 'Client ID', 'Description' => t('The client ID uniquely identifies the site.', 'The client ID uniquely identifies the site. You can generate a new ID with the button at the bottom of this page.')], 'AssociationSecret' => ['LabelCode' => 'Secret', 'Description' => t('The secret secures the sign in process.', 'The secret secures the sign in process. Do <b>NOT</b> give the secret out to anyone.')], 'Name' => ['LabelCode' => 'Site Name', 'Description' => t('Enter a short name for the site.', 'Enter a short name for the site. This is displayed on the signin buttons.')], 'AuthenticateUrl' => ['LabelCode' => 'Authentication URL', 'Description' => t('The location of the JSONP formatted authentication data.')], 'SignInUrl' => ['LabelCode' => 'Sign In URL', 'Description' => t('The url that users use to sign in.') . ' ' . t('Use {target} to specify a redirect.')], 'RegisterUrl' => ['LabelCode' => 'Registration URL', 'Description' => t('The url that users use to register for a new account.')], 'SignOutUrl' => ['LabelCode' => 'Sign Out URL', 'Description' => t('The url that users use to sign out of your site.')], 'Trusted' => ['Control' => 'toggle', 'LabelCode' => 'This is trusted connection and can sync roles & permissions.'], 'IsDefault' => ['Control' => 'toggle', 'LabelCode' => 'Make this connection your default signin method.'], 'Advanced' => ['Control' => 'callback', 'Callback' => function ($form) { return subheading(t('Advanced')); }], 'HashType' => ['Control' => 'dropdown', 'LabelCode' => 'Hash Algorithm', 'Items' => $hashTypes, 'Description' => T('Choose md5 if you\'re not sure what to choose.', "You can select a custom hash algorithm to sign your requests. The hash algorithm must also be used in your client library. Choose md5 if you're not sure what to choose."), 'Options' => ['Default' => 'md5']], 'TestMode' => ['Control' => 'toggle', 'LabelCode' => 'This connection is in test-mode.']]; $sender->setData('_Controls', $controls); $sender->setData('Title', sprintf(T($client_id ? 'Edit %s' : 'Add %s'), T('Connection'))); // Throw a render event as this plugin so that handlers can call our methods. Gdn::pluginManager()->callEventHandlers($this, __CLASS__, 'addedit', 'render'); if ($generate && $sender->deliveryType() === DELIVERY_TYPE_VIEW) { $sender->setJson('AuthenticationKey', $key); $sender->setJson('AssociationSecret', $secret); $sender->render('Blank', 'Utility', 'Dashboard'); } else { $sender->render('Settings_AddEdit', '', 'plugins/jsconnect'); } }
<li><?php echo $testProvider['Name']; ?> </li> <?php } ?> </ul> </div> <?php } ?> <section> <?php echo subheading(t('Signing In')); echo $this->Form->open(); echo $this->Form->errors(); ?> <div class="form-group"> <div class="label-wrap-wide"> <?php echo t('Auto Connect'); ?> <?php echo '<div class="info">' . t('Automatically connect to an existing user account if it has the same email address.') . '</div>'; ?> </div> <div class="input-wrap-right"> <?php echo $this->Form->toggle('Garden.Registration.AutoConnect');
} echo '</li>'; } ?> </ul> </section> <?php } ?> <?php if ($hasCustomText) { ?> <section> <?php echo subheading(t('Text')); ?> <ul> <?php foreach ($this->data('ThemeInfo.Options.Text') as $Code => $Options) { echo '<li class="form-group">'; ?> <div class="label-wrap"> <?php echo $this->Form->label('@' . $Code, 'Text_' . $Code); if (isset($Options['Description'])) { echo '<div class="info">', $Options['Description'], '</div>'; } ?> </div> <div class="input-wrap">