コード例 #1
0
ファイル: gettingstarted.php プロジェクト: vanilla/vanilla
function tutLink($TutorialCode, $WriteTitle = TRUE, $ThumbnailSize = 'medium', $noGrid = false)
{
    $Tutorial = GetTutorials($TutorialCode);
    if (!$Tutorial) {
        return '';
    }
    $Thumbnail = $ThumbnailSize == 'medium' ? $Tutorial['Thumbnail'] : $Tutorial['LargeThumbnail'];
    $noGrid = $noGrid ? 'no-grid' : '';
    echo '<div class="video label-selector-item ' . $noGrid . '">';
    echo '<div class="image-wrap">';
    echo '<img src="' . $Thumbnail . '" alt="' . $Tutorial['Name'] . '" class = "video-img label-selector-image" />';
    ?>
    <a class="overlay" href="<?php 
    echo url('/settings/tutorials/' . $Tutorial['Code']);
    ?>
">
        <div class="buttons">
            <div class="icon-wrapper"><?php 
    echo dashboardSymbol('play');
    ?>
</div>
        </div>
        <div class="selected"></div>
    </a>
    <?php 
    echo '</div>';
    echo $WriteTitle ? wrap($Tutorial['Name'], 'div', ['class' => 'video-title title']) : '';
    echo '</div>';
}
コード例 #2
0
ファイル: class.spoof.plugin.php プロジェクト: vanilla/addons
 /**
  * Adds a "Spoof" link to the user management list.
  */
 public function UserController_UserListOptions_Handler($Sender)
 {
     if (!Gdn::Session()->CheckPermission('Garden.Settings.Manage')) {
         return;
     }
     $User = GetValue('User', $Sender->EventArguments);
     if ($User) {
         echo anchor(dashboardSymbol('spoof'), '/user/autospoof/' . $User->UserID . '/' . Gdn::Session()->TransientKey(), 'js-modal-confirm btn btn-icon', ['aria-label' => t('Spoof'), 'title' => t('Spoof')]);
     }
 }
コード例 #3
0
ファイル: homepage.php プロジェクト: vanilla/vanilla
function writeHomepageOption($Title, $Url, $iconName, $Current, $Description = '')
{
    $iconPath = 'applications/dashboard/design/images/' . $iconName . '.png';
    $cssClass = '';
    if ($Current == $Url) {
        $cssClass = 'active';
    }
    $cssClass .= ' Choice';
    echo wrap('<div class="image-wrap">' . img($iconPath, ['alt' => $Title, 'class' => 'label-selector-image']) . '<div class="overlay">' . '<div class="buttons">' . anchor(t('Select'), $Url, 'btn btn-overlay', ['title' => $Description, 'rel' => $Url]) . '</div>' . '<div class="selected">' . dashboardSymbol('checkmark') . '</div>' . '</div></div>' . '<div class="title">' . t($Title) . '</div>', 'div', array('class' => $cssClass . ' label-selector-item'));
}
コード例 #4
0
ファイル: feeddiscussions.php プロジェクト: vanilla/addons
        ?>
</td>
                        <td><?php 
        echo $LastUpdate;
        ?>
</td>
                        <td><?php 
        echo $Frequency;
        ?>
</td>
                        <td><?php 
        echo $Category;
        ?>
</td>
                        <td class="DeleteFeed">
                            <?php 
        echo anchor(dashboardSymbol('delete'), '/plugin/feeddiscussions/deletefeed/' . FeedDiscussionsPlugin::EncodeFeedKey($FeedURL), 'btn btn-icon', ['aria-label' => t('Delete this Feed')]);
        ?>
                        </td>
                    </tr>
                <?php 
    }
    ?>
                </tbody>
            </table>
        </div>
    <?php 
}
?>
</div>
コード例 #5
0
ファイル: functions.render.php プロジェクト: vanilla/vanilla
 /**
  * Formats a h1 header block for the dashboard. Only to be used once on a page as the h1 header.
  * Handles url-ifying. Adds an optional button or return link.
  *
  * @param string $title The page title.
  * @param string $buttonText The text appearing on the button.
  * @param string $buttonUrl The url for the button.
  * @param string|array $buttonAttributes Can be string CSS class or an array of attributes. CSS class defaults to `btn btn-primary`.
  * @param string $returnUrl The url for the return chrevron button.
  * @return string The structured heading string.
  */
 function heading($title, $buttonText = '', $buttonUrl = '', $buttonAttributes = [], $returnUrl = '')
 {
     if (is_string($buttonAttributes)) {
         $buttonAttributes = ['class' => $buttonAttributes];
     }
     if ($buttonText !== '') {
         if (val('class', $buttonAttributes, false) === false) {
             $buttonAttributes['class'] = 'btn btn-primary';
         }
         $buttonAttributes = attribute($buttonAttributes);
     }
     $button = '';
     if ($buttonText !== '' && $buttonUrl === '') {
         $button = '<button type="button" ' . $buttonAttributes . '>' . $buttonText . '</button>';
     } else {
         if ($buttonText !== '' && $buttonUrl !== '') {
             $button = '<a ' . $buttonAttributes . ' href="' . url($buttonUrl) . '">' . $buttonText . '</a>';
         }
     }
     $title = '<h1>' . $title . '</h1>';
     if ($returnUrl !== '') {
         $title = '<div class="title-block">
             <a class="btn btn-icon btn-return" aria-label="Return" href="' . url($returnUrl) . '">' . dashboardSymbol('chevron-left') . '
             </a>
             <h1>' . $title . '</h1>
         </div>';
     }
     return '<header class="header-block">' . $title . $button . '</header>';
 }
コード例 #6
0
ファイル: mobilethemes.php プロジェクト: vanilla/vanilla
        echo anchor(dashboardSymbol('expand', 'icon-16'), 'dashboard/settings/themeinfo/' . $ThemeName, 'js-modal', ['data-css-class' => 'modal-center modal-md', 'data-modal-type' => 'noheader']);
        ?>
                            </div>
                            <div class="buttons">
                                <?php 
        echo anchor(t('Apply'), 'dashboard/settings/mobilethemes/' . $ThemeName . '/' . $Session->TransientKey(), 'EnableAddon EnableTheme btn btn-overlay', array('target' => '_top'));
        if ($allowPreview) {
            echo anchor(t('Preview'), 'dashboard/settings/previewtheme/' . $ThemeName, 'btn btn-overlay js-preview-addon');
        }
        $this->EventArguments['ThemeInfo'] = $ThemeInfo;
        $this->fireEvent('AfterThemeButtons');
        ?>
                            </div>
                            <div class="selected">
                                <?php 
        echo dashboardSymbol('checkmark');
        ?>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="title">
                    <?php 
        echo $ThemeUrl != '' ? anchor($ScreenName, $ThemeUrl) : $ScreenName;
        ?>
                </div>
                <div class="description">
                    <?php 
        echo $DescriptionHtml;
        ?>
コード例 #7
0
ファイル: index.php プロジェクト: vanilla/vanilla
                    <?php 
    if (val('Type', $Role)) {
        echo t(val('Type', $Role));
    }
    ?>
                </td>
                <td><?php 
    echo anchor($Role['CountUsers'] ?: 0, '/dashboard/user?Filter=' . urlencode($Role['Name']));
    ?>
</td>
                <td class="options">
                    <div class="btn-group">
                    <?php 
    if ($Role['CanModify']) {
        echo anchor(dashboardSymbol('edit'), "/role/edit/{$Role['RoleID']}", 'btn btn-icon', ['aria-label' => t('Edit'), 'title' => t('Edit')]);
        if ($Role['Deletable']) {
            echo anchor(dashboardSymbol('delete'), "/role/delete/{$Role['RoleID']}", 'js-modal btn btn-icon', ['aria-label' => t('Delete'), 'title' => t('Delete')]);
        }
    }
    ?>
                    </div>
                </td>
            </tr>
        <?php 
}
?>
        </tbody>
    </table>
</div>
<?php 
echo $this->Form->close();
コード例 #8
0
ファイル: index.php プロジェクト: vanilla/vanilla
            case 'WarningMessage':
                $type = t('Warning');
                break;
            default:
                $type = t('Casual');
        }
        echo $type;
        ?>
                </td>
                <td class="options">
                    <div class="btn-group">
                        <?php 
        $editAttrs = ['aria-label' => t('Edit'), 'title' => t('Edit')];
        $deleteAttrs = ['aria-label' => t('Delete'), 'title' => t('Delete'), 'data-remove-selector' => '.js-message-' . $Message->MessageID];
        echo anchor(dashboardSymbol('edit'), '/dashboard/message/edit/' . $Message->MessageID, 'js-modal btn btn-icon', $editAttrs);
        echo anchor(dashboardSymbol('delete'), '/dashboard/message/delete/' . $Message->MessageID, 'js-modal-confirm js-hijack btn btn-icon', $deleteAttrs);
        ?>
                        <div id="toggle-<?php 
        echo $messageID = val('MessageID', $Message);
        ?>
">
                            <?php 
        if ($Message->Enabled == '1') {
            echo wrap(anchor('<div class="toggle-well"></div><div class="toggle-slider"></div>', '/dashboard/message/disable/' . $messageID, 'Hijack'), 'span', array('class' => "toggle-wrap toggle-wrap-on"));
        } else {
            echo wrap(anchor('<div class="toggle-well"></div><div class="toggle-slider"></div>', '/dashboard/message/enable/' . $messageID, 'Hijack'), 'span', array('class' => "toggle-wrap toggle-wrap-off"));
        }
        ?>
                        </div>
                    </div>
                </td>
コード例 #9
0
ファイル: table.php プロジェクト: vanilla/vanilla
                </td>
                <td class="DateCell">
                    <?php 
    echo Gdn_Format::date($Row['DateInserted'], '%e %b %Y');
    ?>
                </td>
                <td class="PostedByCell"><?php 
    $RecordUser = Gdn::userModel()->getID($Row['RecordUserID'], DATASET_TYPE_ARRAY);
    if ($Row['RecordName']) {
        $userBlock = new MediaItemModule(val('Name', $RecordUser), userUrl($RecordUser));
        $userBlock->setView('media-sm')->addMeta(plural($RecordUser['CountDiscussions'] + $RecordUser['CountComments'], '%s post', '%s posts'))->addMetaIf($RecordUser['Banned'] ? true : false, wrap(t('Banned'), 'span', ['class' => 'text-danger']))->addMetaIf($viewPersonalInfo && val('RecordIPAddress', $Row), iPAnchor($Row['RecordIPAddress']));
        echo $userBlock;
    }
    ?>
                </td>
                <td class="options">
                    <?php 
    if ($Url) {
        $attr = ['title' => t('View Post'), 'aria-label' => t('View Post'), 'class' => 'btn btn-icon btn-icon-sm'];
        echo anchor(dashboardSymbol('external-link', 'icon icon-text'), $Url, '', $attr);
    }
    ?>
                </td>
            </tr>
        <?php 
}
?>
        </tbody>
    </table>
</div>
コード例 #10
0
ファイル: confirm.php プロジェクト: vanilla/vanilla
    exit;
}
?>
<div class="modal-dialog modal-sm modal-confirm" role="document">
    <div class="modal-content">
        <?php 
$ItemCount = $this->data('ItemCount');
$title = '';
if ($this->data('ItemCount')) {
    $title = t('Please Confirm');
}
?>
        <div class="modal-header">
            <button type="button" class="btn-icon modal-close close Close" aria-label="Close">
                <?php 
echo dashboardSymbol('close');
?>
            </button>
            <h4 class="modal-title"><?php 
echo $title;
?>
</h4>
        </div>
        <?php 
if (!$ItemCount) {
    ?>
            <?php 
    echo '<div class="modal-body">', t('Make sure you select at least one item before continuing.'), '</div>';
} else {
    ?>
            <?php 
コード例 #11
0
ファイル: tutorials.php プロジェクト: vanilla/vanilla
        <div class="video-section-heading"><?php 
echo t('Other Tutorials');
?>
</div>
        <div class="videos label-selector">
        <?php 
foreach ($Tutorials as $Tutorial) {
    $current = $CurrentTutorialCode == $Tutorial['Code'] ? 'active' : '';
    echo '<div class="video label-selector-item ' . $current . '">';
    echo '<div class="image-wrap">';
    echo '<img src="' . $Tutorial['Thumbnail'] . '" alt="' . $Tutorial['Name'] . '" class = "video-img label-selector-image" />';
    ?>
            <a class="overlay" href="<?php 
    echo url('/settings/tutorials/' . $Tutorial['Code']);
    ?>
">
                <div class="icon-wrapper"><?php 
    echo dashboardSymbol('play');
    ?>
</div>
            </a>
            <?php 
    echo '</div>';
    echo wrap($Tutorial['Name'], 'div', ['class' => 'video-title title']);
    echo '</div>';
}
?>
        </div>
    </div>
</div>
コード例 #12
0
ファイル: forum.php プロジェクト: vanilla/vanilla
<div class="row form-group">
    <div class="label-wrap-wide">
        <div class="label"><?php 
echo t('Embed My Forum');
?>
</div>
        <div class="label-description"><?php 
echo t('If you want to embed your forum or use Vanilla\'s comments in your blog then you need to enable embedding. If you aren\'t using embedding then we recommend leaving this setting off.');
?>
</div>
    </div>
    <div class="input-wrap-right">
    <span id="plaintext-toggle">
        <?php 
if (c('Garden.Embed.Allow', false)) {
    echo wrap(anchor('<div class="toggle-well"></div><div class="toggle-slider"></div>', 'embed/forum/disable/' . Gdn::session()->TransientKey()), 'span', array('class' => "toggle-wrap toggle-wrap-on"));
} else {
    echo wrap(anchor('<div class="toggle-well"></div><div class="toggle-slider"></div>', 'embed/forum/enable/' . Gdn::session()->TransientKey()), 'span', array('class' => "toggle-wrap toggle-wrap-off"));
}
?>
    </span>
    </div>
</div>
<?php 
$nav = new NavModule();
$nav->addLink(t('Vanilla Plugin for WordPress'), 'embed/wordpress', 'embed.wordpress', '', [], ['icon' => dashboardSymbol('plugin'), 'description' => t('Use Vanilla\'s Wordpress plugin if you want to embed in WordPress site.')]);
$nav->addLink(t('Universal Forum Embed Code'), 'embed/universal', 'embed.universal', '', [], ['icon' => dashboardSymbol('code'), 'description' => t('Use the forum embed code to embed the entire forum in a non-WordPress site.')]);
$nav->addLink(t('Universal Comment Embed Code'), 'embed/comments', 'embed.comments', '', [], ['icon' => dashboardSymbol('code-bubble'), 'description' => t('Use the comment embed code to embed Vanilla comments into a non-WordPress site.')]);
$nav->addLink(t('Embed Settings'), 'embed/settings', 'embed.settings', '', [], ['icon' => dashboardSymbol('settings'), 'description' => t('Use the comment embed code to embed Vanilla comments into a non-WordPress site.')]);
$nav->setView('nav-adventure');
echo $nav;
コード例 #13
0
ファイル: banstable.php プロジェクト: vanilla/vanilla
    ?>
                </td>
                <td>
                    <?php 
    echo $Row['CountBlockedRegistrations'];
    ?>
                </td>
                <td class="UsernameCell"><?php 
    echo htmlspecialchars($Row['InsertName']);
    ?>
</td>
                <td><?php 
    echo htmlspecialchars($Row['Notes']);
    ?>
</td>
                <td class="options">
                    <div class="btn-group">
                    <?php 
    echo anchor(dashboardSymbol('edit'), "/dashboard/settings/bans/edit?id={$Row['BanID']}", 'js-modal btn btn-icon', ['aria-label' => t('Edit'), 'title' => t('Edit')]);
    echo anchor(dashboardSymbol('delete'), "/dashboard/settings/bans/delete?id={$Row['BanID']}", 'js-modal-confirm js-hijack btn btn-icon', ['aria-label' => t('Delete'), 'title' => t('Delete')]);
    ?>
                    </div>
                </td>
            </tr>
        <?php 
}
?>
        </tbody>
    </table>
</div>
コード例 #14
0
ファイル: index.php プロジェクト: vanilla/addons
    if ($page = htmlspecialchars($PocketRow['Page'])) {
        echo '<div class="info pocket-page">' . sprintf(t('%s: %s'), t('Page'), $page) . '</div>';
    }
    if ($location = htmlspecialchars($PocketRow['Location'])) {
        echo '<div class="info pocket-location">' . sprintf(t('%s: %s'), t('Location'), $location) . '</div>';
    }
    if ($MobileOnly) {
        echo '<div class="info">(', t('Shown only on mobile'), ')</div>';
    }
    if ($MobileNever) {
        echo '<div class="info">(', t('Hidden for mobile'), ')</div>';
    }
    if ($MobileNever && $MobileOnly) {
        echo '<div class="info">(', t('Hidden for everything!'), ')</div>';
    }
    if ($NoAds) {
        echo '<div class="info">(', t('Users with the no ads permission will not see this pocket.'), ')</div>';
    }
    '</td>';
    echo '<td><pre style="white-space: pre-wrap;">', nl2br(htmlspecialchars(substr($PocketRow['Body'], 0, 200))), '</pre></td>';
    echo '<td class="options"><div class="btn-group">';
    echo anchor(dashboardSymbol('edit'), "/settings/pockets/edit/{$PocketRow['PocketID']}", 'js-modal btn btn-icon', ['aria-label' => t('Edit'), 'title' => t('Edit'), 'data-content' => ['cssClass' => 'pockets']]);
    echo anchor(dashboardSymbol('delete'), "/settings/pockets/delete/{$PocketRow['PocketID']}", 'Popup btn btn-icon', ['aria-label' => t('Delete'), 'title' => t('Delete')]);
    echo '</div></td>';
    echo "</tr>\n";
}
?>
        </tbody>
    </table>
</div>
コード例 #15
0
ファイル: themes.php プロジェクト: vanilla/vanilla
                                    <?php 
        echo anchor(t('Apply'), 'dashboard/settings/themes/' . $ThemeName . '/' . $Session->TransientKey(), 'btn btn-overlay EnableAddon EnableTheme', array('target' => '_top'));
        if ($allowPreview) {
            echo anchor(t('Preview'), 'dashboard/settings/previewtheme/' . $ThemeName, 'btn btn-overlay js-preview-addon');
        }
        $this->EventArguments['ThemeInfo'] = $ThemeInfo;
        $this->fireEvent('AfterThemeButtons');
        ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="title">
                        <?php 
        if ($ThemeUrl != '') {
            echo $ScreenName . ' ' . anchor(dashboardSymbol('external-link', 'icon-text'), $ThemeUrl, '', ['title' => t('Theme website')]);
        } else {
            echo $ScreenName;
        }
        ?>
                    </div>


                    <div class="description">
                        <?php 
        $Description = val('Description', $ThemeInfo);
        if ($Description) {
            echo '<div class="theme-description">' . $Description . '</div>';
        }
        $RequiredApplications = val('RequiredApplications', $ThemeInfo, false);
        if (is_array($RequiredApplications)) {
コード例 #16
0
ファイル: helper_functions.php プロジェクト: vanilla/vanilla
/**
 * Converts addon info into a media item.
 *
 * @param $addonName
 * @param $addonInfo
 * @param $isEnabled
 * @param $addonType
 * @param $filter
 */
function writeAddonMedia($addonName, $addonInfo, $isEnabled, $addonType, $filter)
{
    $capitalCaseSheme = new \Vanilla\Utility\CapitalCaseScheme();
    $addonInfo = $capitalCaseSheme->convertArrayKeys($addonInfo, ['RegisterPermissions']);
    $screenName = Gdn_Format::display(val('Name', $addonInfo, $addonName));
    $description = Gdn_Format::html(t(val('Name', $addonInfo, $addonName) . ' Description', val('Description', $addonInfo, '')));
    $id = Gdn_Format::url($addonName) . '-addon';
    $media = new MediaItemModule($screenName, '', $description, 'li', ['id' => $id]);
    $media->setView('media-addon');
    // Icon
    $addon = Gdn::addonManager()->lookupAddon($addonName);
    $iconPath = '';
    if ($addon) {
        $iconPath = $addon->getIcon();
    }
    if (!$iconPath) {
        $iconPath = val('IconUrl', $addonInfo, 'applications/dashboard/design/images/addon-placeholder.png');
    }
    $media->setImage($iconPath);
    // Settings button
    $settingsUrl = $isEnabled ? val('SettingsUrl', $addonInfo, '') : '';
    $settingsPopupClass = val('UsePopupSettings', $addonInfo, true) ? ' js-modal' : '';
    if ($settingsUrl != '') {
        $attr['class'] = 'btn btn-icon-border' . $settingsPopupClass;
        $attr['aria-label'] = sprintf(t('Settings for %s'), $screenName);
        $attr['data-reload-page-on-save'] = false;
        $media->addButton(dashboardSymbol('settings'), $settingsUrl, $attr);
    }
    // Toggle
    if ($addonType === 'locales') {
        $action = $isEnabled ? 'disable' : 'enable';
    } else {
        $action = $filter;
    }
    if ($isEnabled) {
        $label = sprintf(t('Disable %s'), $screenName);
    } else {
        $label = sprintf(t('Enable %s'), $screenName);
    }
    $url = '/settings/' . $addonType . '/' . $action . '/' . $addonName;
    $media->setToggle(slugify($addonName), $isEnabled, $url, $label);
    // Meta
    $info = [];
    // Requirements
    $requiredApplications = val('RequiredApplications', $addonInfo, false);
    $requiredPlugins = val('RequiredPlugins', $addonInfo, false);
    $requirements = [];
    if (is_array($requiredApplications)) {
        foreach ($requiredApplications as $requiredApplication => $versionInfo) {
            $requirements[] = sprintf(t('%1$s Version %2$s'), $requiredApplication, $versionInfo);
        }
    }
    if (is_array($requiredPlugins)) {
        foreach ($requiredPlugins as $requiredPlugin => $versionInfo) {
            $requirements[] = sprintf(t('%1$s Version %2$s'), $requiredPlugin, $versionInfo);
        }
    }
    if (!empty($requirements)) {
        $requirementsMeta = sprintf(t('Requires: %s'), implode(', ', $requirements));
        $info[] = $requirementsMeta;
    }
    // Authors
    $author = val('Author', $addonInfo, '');
    $authors = [];
    // Check if singular author is set
    if ($author) {
        $authorUrl = val('AuthorUrl', $addonInfo, '');
        if ($authorUrl) {
            $authors[] = anchor($author, $authorUrl);
        } else {
            $authors[] = $author;
        }
    }
    // Check for multiple authors
    foreach (val('Authors', $addonInfo, []) as $author) {
        if (val('Homepage', $author)) {
            $authors[] = anchor(val('Name', $author), val('Homepage', $author));
        } else {
            $authors[] = val('Name', $author);
        }
    }
    if ($authors) {
        $authors = implode(', ', $authors);
        $info[] = sprintf(t('Created by %s'), $authors);
    }
    // Version Info
    $version = Gdn_Format::display(val('Version', $addonInfo, ''));
    $newVersion = val('NewVersion', $addonInfo, '');
    $upgrade = $newVersion != '' && version_compare($newVersion, $version, '>');
    if ($version != '') {
        $info[] = sprintf(t('Version %s'), $version);
    }
    $pluginUrl = val('PluginUrl', $addonInfo, '');
    if ($upgrade && $pluginUrl) {
        $info[] = anchor(printf(t('%1$s version %2$s is available.'), $screenName, $newVersion), combinePaths(array($pluginUrl, 'find', urlencode($screenName)), '/'));
    }
    if ($pluginUrl != '') {
        $info[] = anchor(t('Visit Site'), $pluginUrl);
    }
    // Extra meta in addon array
    if ($meta = val('Meta', $addonInfo)) {
        foreach ($meta as $key => $value) {
            if (is_numeric($key)) {
                $info[] = $value;
            } else {
                $info[] = t($key) . ': ' . $value;
            }
        }
    }
    $media->setMeta($info);
    echo $media;
}
コード例 #17
0
ファイル: admin.master.php プロジェクト: vanilla/vanilla
    $photo = '<img src="' . userPhotoUrl($user) . '">';
    $attr = ['class' => 'navbar-profile js-drop', 'data-content-id' => 'cardUserContent', 'id' => 'cardUserTrigger'];
    echo wrap($photo . ' <span class="icon icon-caret-down"></span>', 'div', $attr);
}
?>
        </div>
    </header>
    <div class="main-row pusher<?php 
echo $this->data('IsWidePage') ? ' main-row-wide' : '';
?>
" id="main-row">
        <div class="panel panel-left js-drawer">
            <div class="panel-nav panel-content-wrapper">
                <div id="panel-nav" class="js-fluid-fixed panel-content">
                    <?php 
echo anchor($title . ' ' . dashboardSymbol('external-link', 'icon-16'), '/', 'title');
?>
                    <?php 
echo $dashboardNav;
?>
                </div>
            </div>
        </div>
        <div class="panel panel-help panel-right">
            <div class="panel-content-wrapper">
                <div id="fixed-help" class="js-fluid-fixed panel-content">
                    <?php 
$this->renderAsset('Help');
?>
                </div>
            </div>
コード例 #18
0
ファイル: settings.php プロジェクト: vanilla/vanilla
    echo val('Required', $Field, 0) ? t('Yes') : t('No');
    ?>
</td>
                <td><?php 
    echo val('OnRegister', $Field, 0) ? t('Yes') : t('No');
    ?>
</td>
                <td><?php 
    echo val('OnProfile', $Field, 1) ? t('Yes') : t('No');
    ?>
</td>
                <!--<td><?php 
    echo val('OnDiscussion', $Field, 0) ? t('Yes') : t('No');
    ?>
</td>-->
                <td class="options">
                    <div class="btn-group">
                    <?php 
    echo anchor(dashboardSymbol('edit'), '/settings/profilefieldaddedit/' . $Name, 'js-modal btn btn-icon', ['aria-label' => t('Edit'), 'title' => t('Edit')]);
    echo anchor(dashboardSymbol('delete'), '/settings/profilefielddelete/' . $Name, 'js-modal btn btn-icon', ['aria-label' => t('Delete'), 'title' => t('Delete'), 'data-css-class' => 'modal-sm modal-confirm']);
    ?>
                    </div>
                </td>
            </tr>
        <?php 
}
?>
        </tbody>
    </table>
</div>
コード例 #19
0
ファイル: nav-adventure.php プロジェクト: vanilla/vanilla
    function renderAdventureNav($items)
    {
        foreach ($items as $item) {
            if (val('type', $item) == 'group') {
                $heading = val('text', $item);
                if (!$heading) {
                    touchValue('cssClass', $item, '');
                    $item['cssClass'] .= ' nav-group-noheading';
                }
                ?>
                <div type="group" class="nav-group <?php 
                echo val('cssClass', $item);
                ?>
">
                <?php 
                if ($heading) {
                    echo '<h3>' . val('text', $item) . '</h3>';
                }
                if (val('items', $item)) {
                    renderAdventureNav(val('items', $item));
                }
                echo '</div>';
            }
            if (val('type', $item) == 'link') {
                ?>
                <div class="nav-item">
                    <a role="menuitem" class="nav-link <?php 
                echo val('cssClass', $item);
                ?>
" tabindex="-1"
                        href="<?php 
                echo url(val('url', $item));
                ?>
">
                        <div class="nav-item-icon"><?php 
                echo icon(val('icon', $item));
                ?>
</div>
                        <div class="nav-item-content">
                            <div class="nav-item-title"><?php 
                echo val('text', $item);
                ?>
</div>
                            <div class="nav-item-description">
                                <?php 
                echo val('description', $item);
                ?>
                            </div>
                        </div>
                        <div class="nav-item-arrow"><?php 
                echo dashboardSymbol('chevron-right');
                ?>
</div>
                    </a>
                </div>
                <?php 
            }
            if (val('type', $item) == 'divider') {
                echo '<hr/>';
            }
        }
    }
コード例 #20
0
ファイル: class.form.php プロジェクト: vanilla/vanilla
 /**
  * Renders a stylized search field. Requires dashboard.css to look as intended. Use with searchForm() to output an
  * entire search form.
  *
  * @param string $field The search field, supported field names are 'search' or 'Keywords'
  * @param string $url The url to show the search results.
  * @param array $textBoxAttributes The attributes for the text box. Placeholders go here.
  * @param string $searchInfo The info to add under the search box, usually a result count.
  * @return string The rendered search field.
  */
 public function searchInput($field, $url, $textBoxAttributes = [], $searchInfo = '')
 {
     $clear = '';
     $searchTermFound = false;
     $searchKeys = ['search', 'keywords'];
     $getValues = Gdn::request()->get();
     // Check to see if any values in the above array exist in the get request and if so, add a clear button.
     foreach ($getValues as $key => $value) {
         if (in_array(strtolower($key), $searchKeys)) {
             $searchTermFound = true;
         }
     }
     if ($searchTermFound) {
         $closeIcon = dashboardSymbol('close');
         $clear = '<a class="search-icon-wrap search-icon-clear-wrap" href="' . url($url) . '">' . $closeIcon . '</a>';
     }
     if ($searchInfo) {
         $searchInfo = '<div class="info search-info">' . $searchInfo . '</div>';
     }
     return '
         <div class="search-wrap input-wrap" role="search">
             <div class="search-icon-wrap search-icon-search-wrap">' . dashboardSymbol('search') . '</div>' . $this->textBox($field, $textBoxAttributes) . $this->button('Go', ['class' => 'search-submit']) . $clear . $searchInfo . '
         </div>';
 }
コード例 #21
0
ファイル: users.php プロジェクト: vanilla/vanilla
</td>
        <?php 
    }
    ?>
        <?php 
    $this->EventArguments['User'] = $User;
    $this->fireEvent('UserCell');
    ?>
        <?php 
    if ($EditUser || $DeleteUser) {
        ?>
            <td class="options">
                <div class="btn-group">
                <?php 
        if ($EditUser) {
            echo anchor(dashboardSymbol('edit'), '/user/edit/' . $User->UserID, 'js-modal btn btn-icon', ['aria-label' => t('Edit'), 'title' => t('Edit')]);
        }
        if ($DeleteUser && $User->UserID != $Session->User->UserID) {
            echo anchor(dashboardSymbol('delete'), '/user/delete/' . $User->UserID, 'btn btn-icon', ['aria-label' => t('Delete'), 'title' => t('Delete')]);
        }
        $this->EventArguments['User'] = $User;
        $this->fireEvent('UserListOptions');
        ?>
                </div>
            </td>
        <?php 
    }
    ?>
    </tr>
<?php 
}
コード例 #22
0
ファイル: applicants.php プロジェクト: vanilla/vanilla
        }
        // Opportunity for plugins to do arbitrary appending.
        $this->fireEvent("AppendApplicantInfo");
        ?>
                    </td>
                    <td><?php 
        echo ipAnchor($User->InsertIPAddress);
        ?>
</td>
                    <td><?php 
        echo Gdn_Format::date($User->DateInserted);
        ?>
</td>
                    <td class="options">
                        <div class="btn-group">
                        <?php 
        echo anchor(dashboardSymbol('checkmark'), '/user/approve/' . $User->UserID, 'ApproveApplicant btn btn-icon', ['aria-label' => t('Approve'), 'title' => t('Approve')]);
        echo anchor(dashboardSymbol('delete'), '/user/decline/' . $User->UserID . '/' . $Session->TransientKey(), 'DeclineApplicant btn btn-icon', ['aria-label' => t('Decline'), 'title' => t('Decline')]);
        ?>
                        </div>
                    </td>
                </tr>
            <?php 
    }
    ?>
            </tbody>
        </table>
    </div>
    <?php 
}
echo $this->Form->close();
コード例 #23
0
ファイル: pager-dashboard.php プロジェクト: vanilla/vanilla
if ($pagerType === 'more' && ($pager->CurrentRecords === false || $pager->CurrentRecords < $pager->Limit)) {
    $hasNext = false;
}
$pagerString = '<div class="pager">';
$pagerCount = '<div class="pager-count">';
$pagerCount .= sprintf(t('Page %s of %s'), $currentPage, $pageCount ? $pageCount : 1);
$pagerCount .= '</div>';
if ($pagerType === 'more') {
    $pagerCount = '<div class="pager-count">';
    $pagerCount .= sprintf(t('Page %s'), $currentPage);
    $pagerCount .= '</div>';
}
$pagerString .= $pagerCount;
$pagerString .= '<nav class="btn-group">';
// Previous
if ($currentPage == 1) {
    $disabled = 'disabled';
} else {
    $disabled = '';
}
$pagerString .= anchor(dashboardSymbol("chevron-left"), $pager->PageUrl($currentPage - 1), $disabled . ' Previous pager-previous btn btn-icon-border', array('rel' => 'prev', 'aria-label' => 'Previous page'));
// Next
if (!$hasNext) {
    $disabled = 'disabled';
} else {
    $disabled = '';
}
$pagerString .= anchor(dashboardSymbol("chevron-right"), $pager->PageUrl($currentPage + 1), $disabled . ' Next pager-next btn btn-icon-border', array('rel' => 'next', 'aria-label' => 'Next page'));
// extra sprintf parameter in case old url style is set
$pagerString .= '</nav></div>';
echo '<div class="pager-wrap ' . $pager->CssClass . '">' . $pagerString . '</div>';
コード例 #24
0
ファイル: dashboard.php プロジェクト: vanilla/vanilla
?>
</button>
        <button disabled="disabled" id="StatsSlotMonth" class="btn btn-secondary"><?php 
echo t('Month');
?>
</button>
    </div>
    <div id="StatsNavigation" class="pager">
        <div id="StatsCurrentTimeframe" class="pager-count"></div>
        <div class="btn-group pager-wrap">
            <button disabled="disabled" id="StatsNavPrev" class="btn btn-icon-border"><?php 
echo dashboardSymbol('chevron-left');
?>
</button>
            <button disabled="disabled" id="StatsNavNext" class="btn btn-icon-border"><?php 
echo dashboardSymbol('chevron-right');
?>
</button>
            <button disabled="disabled" id="StatsNavToday" class="btn btn-secondary"><?php 
echo t('Today');
?>
</button>
        </div>
    </div>
</div>

<div id="StatsChart"></div>

<div class="summaries js-dashboard-widgets-summaries">
    <div class="Loading"></div>
</div>
コード例 #25
0
ファイル: index.php プロジェクト: vanilla/vanilla
                <td class="strong"><?php 
    echo $Route;
    ?>
</td>
                <td class="Alt"><?php 
    echo $Target;
    ?>
</td>
                <td class="Alt"><?php 
    echo $RouteType;
    ?>
</td>
                <td class="options">
                    <div class="btn-group">
                    <?php 
    echo anchor(dashboardSymbol('edit'), '/dashboard/routes/edit/' . trim($RouteData['Key'], '='), 'js-modal btn btn-icon', ['aria-label' => t('Edit'), 'title' => t('Edit')]);
    if (!$Reserved) {
        echo anchor(dashboardSymbol('delete'), '/routes/delete/' . trim($RouteData['Key'] . '=') . '/' . $Session->TransientKey(), 'js-modal-confirm btn btn-icon', ['aria-label' => t('Delete'), 'title' => t('Delete')]);
    }
    ?>
                    </div>
                </td>
            </tr>
            <?php 
    ++$i;
}
?>
        </tbody>
    </table>
</div>
コード例 #26
0
ファイル: tagging.php プロジェクト: vanilla/vanilla
    ?>
                </td>
                <td class="count">
                    <?php 
    echo $count;
    ?>
                </td>
                <?php 
    if ($CanAddTags) {
        ?>
                    <td class="options">
                        <div class="btn-group">
                            <?php 
        if (!$Special) {
            echo anchor(dashboardSymbol('edit'), "/settings/tags/edit/{$Tag['TagID']}", 'js-modal btn btn-icon', ['aria-label' => t('Edit'), 'title' => t('Edit')]);
            echo anchor(dashboardSymbol('delete'), "/settings/tags/delete/{$Tag['TagID']}", 'js-modal-confirm js-hijack btn btn-icon', ['aria-label' => t('Delete'), 'title' => t('Delete'), 'data-body' => sprintf(t('Are you sure you want to delete this %s?'), t('tag'))]);
        }
        ?>
                        </div>
                    </td>
                <?php 
    }
    ?>
            </tr>
            <?php 
}
?>
        </tbody>
    </table>
</div>
コード例 #27
0
ファイル: settings.php プロジェクト: vanilla/addons
</td>
                <td><?php 
    echo htmlspecialchars($Provider['Name']);
    ?>
</td>
                <td><?php 
    echo htmlspecialchars($Provider['AuthenticateUrl']);
    ?>
</td>
                <td>
                    <?php 
    echo anchor(t('Test URL'), str_replace('=?', '=test', JsConnectPlugin::connectUrl($Provider, TRUE)));
    ?>
                    <div class="JsConnectContainer UserInfo"></div>
                </td>
                <td class="options">
                    <div class="btn-group">
                        <?php 
    echo anchor(dashboardSymbol('edit'), '/settings/jsconnect/addedit?client_id=' . urlencode($Provider['AuthenticationKey']), 'js-modal btn btn-icon', ['aria-label' => t('Edit'), 'title' => t('Edit')]);
    echo anchor(dashboardSymbol('delete'), '/settings/jsconnect/delete?client_id=' . urlencode($Provider['AuthenticationKey']), 'js-modal-confirm js-hijack btn btn-icon', ['aria-label' => t('Delete'), 'title' => t('Delete')]);
    ?>
                    </div>
                </td>
            </tr>
        <?php 
}
?>
        </tbody>
    </table>
</div>