SproutCMS

This is the code documentation for the SproutCMS project

class Constants

A bunch of different constants

Source code (45 results)

/modules/Welcome/Controllers/WelcomeController.php   Highlighted file source

Line 25: use Sprout\Helpers\Constants;
Line 29: use Sprout\Helpers\FileConstants;
Line 590: $hashed = Auth::hashPassword($_POST['password1'], Constants::PASSWORD_BCRYPT12);
Line 695: $data['type'] = FileConstants::TYPE_IMAGE;
Line 709: File::postUploadProcessing("{$file_id}_{$filename}", $file_id, FileConstants::TYPE_IMAGE);

/sprout/Controllers/Admin/FileAdminController.php   Highlighted file source

Line 33: use Sprout\Helpers\FileConstants;
Line 79: 'Type' => [new ColModifierLookupArray(FileConstants::$type_names), 'type'],
Line 93: $this->refine_bar->addWidget(new RefineWidgetSelect('type', 'Type', FileConstants::$type_names));
Line 119: if (!empty($file['type']) and $file['type'] == FileConstants::TYPE_IMAGE) $list['embed_author'] = 'Embed author credit in image';
Line 309: $data['type'] = FileConstants::TYPE_OTHER;
Line 311: foreach (FileConstants::$type_exts as $type => $exts) {
Line 332: if ($data['type'] == FileConstants::TYPE_IMAGE) {
Line 400: if ($type == FileConstants::TYPE_IMAGE) {
Line 622: foreach (FileConstants::$type_exts as $type => $exts) {
Line 629: if ($file_type == 0) $file_type = FileConstants::TYPE_OTHER;
Line 703: if ($view->data['type'] == FileConstants::TYPE_IMAGE) {
Line 724: } else if ($view->data['type'] == FileConstants::TYPE_DOCUMENT) {
Line 789: $valid->addFieldError('replace', 'File must be of type: ' . FileConstants::$type_names[$file['type']]);
Line 812: if ($file['type'] == FileConstants::TYPE_DOCUMENT) {
Line 820: } else if ($file['type'] == FileConstants::TYPE_IMAGE) {
Line 845: if ($file['type'] == FileConstants::TYPE_IMAGE) {
Line 906: if ($file['type'] == FileConstants::TYPE_IMAGE) {
Line 929: } elseif ($file['type'] == FileConstants::TYPE_DOCUMENT) {
Line 938: if ($file['type'] == FileConstants::TYPE_IMAGE and $needs_regenerate_sizes) {
Line 951: if ($file['type'] == FileConstants::TYPE_IMAGE) {
Line 983: if ($file['type'] == FileConstants::TYPE_IMAGE) {
Line 1172: } else if ($file['type'] == FileConstants::TYPE_NONE) {
Line 1240: } else if ($file['type'] == FileConstants::TYPE_NONE) {
Line 1456: if ($_GET['f_type'] == FileConstants::TYPE_IMAGE or strpos(File::mimetype($row['filename']), 'image/') === 0) {

/sprout/Controllers/Admin/HasCategoriesAdminController.php   Highlighted file source

Line 24: use Sprout\Helpers\Constants;
Line 148: $_GET['category_type'] = Constants::CATEGORIES_CURRENT;
Line 152: $clause = Constants::$category_admin_where[$_GET['category_type']];

/sprout/Controllers/Admin/ManagedAdminController.php   Highlighted file source

Line 26: use Sprout\Helpers\Constants;
Line 202: $this->refine_bar->addWidget(new RefineWidgetSelect('_date_modified', 'Date modified', Constants::$recent_dates));
Line 203: $this->refine_bar->addWidget(new RefineWidgetSelect('_date_added', 'Date added', Constants::$recent_dates));

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 33: use Sprout\Helpers\Constants;
Line 40: use Sprout\Helpers\FileConstants;
Line 218: 'admin_perm_type' => Constants::PERM_INHERIT,
Line 362: $update_fields['admin_perm_type'] = Constants::PERM_SPECIFIC;
Line 364: $update_fields['admin_perm_type'] = Constants::PERM_INHERIT;
Line 369: $update_fields['user_perm_type'] = Constants::PERM_SPECIFIC;
Line 371: $update_fields['user_perm_type'] = Constants::PERM_INHERIT;
Line 693: $update_fields['type'] = FileConstants::TYPE_IMAGE;
Line 1040: if ($data['admin_perm_type'] == Constants::PERM_SPECIFIC) {
Line 1049: if ($data['user_perm_type'] == Constants::PERM_SPECIFIC) {
Line 1562: $update_fields['admin_perm_type'] = Constants::PERM_SPECIFIC;
Line 1564: $update_fields['admin_perm_type'] = Constants::PERM_INHERIT;
Line 1569: $update_fields['user_perm_type'] = Constants::PERM_SPECIFIC;
Line 1571: $update_fields['user_perm_type'] = Constants::PERM_INHERIT;

/sprout/Controllers/Admin/WorkerJobAdminController.php   Highlighted file source

Line 19: use Sprout\Helpers\Constants;
Line 62: $this->refine_bar->addWidget(new RefineWidgetSelect('status', 'Status', Constants::$job_status));

/sprout/Controllers/AdminController.php   Highlighted file source

Line 37: use Sprout\Helpers\Constants;
Line 159: $msg = Sprout::extraPage(Constants::EXTRAPAGES_ADMIN_LOGIN);

/sprout/Controllers/AdvancedSearchController.php   Highlighted file source

Line 230: * Take the datespec on the key side of Constants::$relative_dates and turn into a WHERE clause

/sprout/Controllers/DbToolsController.php   Highlighted file source

Line 35: use Sprout\Helpers\Constants;
Line 2363: $data = Auth::hashPassword($_POST['pass'], Constants::PASSWORD_BCRYPT12);

/sprout/Controllers/FileController.php   Highlighted file source

Line 23: use Sprout\Helpers\FileConstants;
Line 152: foreach (FileConstants::$image_ratios as $orient_name => $orient_ratio) {

/sprout/Controllers/FileUploadController.php   Highlighted file source

Line 21: use Sprout\Helpers\FileConstants;
Line 370: if ($data['type'] == FileConstants::TYPE_IMAGE) {

/sprout/Controllers/Tinymce4Controller.php   Highlighted file source

Line 25: use Sprout\Helpers\FileConstants;
Line 104: $res = Pdb::q($q, [FileConstants::TYPE_IMAGE], 'pdo');
Line 140: $res = Pdb::q($q, [$category_id, FileConstants::TYPE_IMAGE], 'pdo');
Line 174: $res = Pdb::q($q, [FileConstants::TYPE_IMAGE, $safe_key, $safe_key], 'pdo');
Line 394: $res = Pdb::q($q, [FileConstants::TYPE_VIDEO], 'pdo');
Line 431: $res = Pdb::q($q, [FileConstants::TYPE_VIDEO, $category_id], 'pdo');
Line 465: $res = Pdb::q($q, [FileConstants::TYPE_VIDEO, $safe_key, $safe_key], 'pdo');
Line 501: $view->f_type = FileConstants::TYPE_IMAGE;
Line 505: $view->f_type = FileConstants::TYPE_VIDEO;
Line 509: $view->f_type = FileConstants::TYPE_DOCUMENT;
Line 548: $categories = Pdb::q($q, [FileConstants::TYPE_IMAGE], 'arr');

/sprout/Helpers/Admin.php   Highlighted file source

Line 870: if (strtotime($row['date_modified']) + Constants::LOCK_AGE < time()) {
Line 978: if (strtotime($row['date_modified']) + Constants::LOCK_AGE < time()) {

/sprout/Helpers/AdminAuth.php   Highlighted file source

Line 199: if (!self::doPasswordCheck($details['hash'], Constants::PASSWORD_BCRYPT12, $details['salt'], $password)) continue;

/sprout/Helpers/AdminPerms.php   Highlighted file source

Line 102: case Constants::PERM_INHERIT:
Line 107: case Constants::PERM_SPECIFIC:

/sprout/Helpers/AttrEditorImage.php   Highlighted file source

Line 34: return Fb::fileSelector('value', [], ['required' => true, 'filter' => FileConstants::TYPE_IMAGE]);

/sprout/Helpers/Auth.php   Highlighted file source

Line 30: * @param int $algorithm Password algorithm, {@see Constants}
Line 38: case Constants::PASSWORD_SHA:
Line 42: case Constants::PASSWORD_SHA_SALT:
Line 46: case Constants::PASSWORD_SHA_SALT_5000:
Line 53: case Constants::PASSWORD_BCRYPT12:
Line 67: * @param int $algorithmPassword algorithm, {@see Constants}. If not specified, the default is used.
Line 77: case Constants::PASSWORD_PLAIN:
Line 78: case Constants::PASSWORD_SHA:
Line 82: case Constants::PASSWORD_SHA_SALT:
Line 87: case Constants::PASSWORD_SHA_SALT_5000:
Line 95: case Constants::PASSWORD_BCRYPT12:
Line 120: * @param int $algorithm Password algorithm, {@see Constants}
Line 126: case Constants::PASSWORD_SHA:
Line 127: case Constants::PASSWORD_SHA_SALT:
Line 128: case Constants::PASSWORD_PLAIN:
Line 129: case Constants::PASSWORD_SHA_SALT_5000:
Line 132: case Constants::PASSWORD_BCRYPT12:
Line 144: * @return int Password algorithm, {@see Constants}
Line 148: if (self::checkAlgorithm(Constants::PASSWORD_BCRYPT12)) {
Line 149: return Constants::PASSWORD_BCRYPT12;
Line 151: return Constants::PASSWORD_SHA_SALT_5000;

/sprout/Helpers/Constants.php   Highlighted file source

Line 20: * A bunch of different constants
Line 22: class Constants
Line 76: * @param string $class The class to look for constants in.
Line 85: $constants = $refl_class->getConstants();
Line 86: foreach ($constants as $name => $val) {

/sprout/Helpers/Fb.php   Highlighted file source

Line 512: if ($type == FileConstants::TYPE_IMAGE) {
Line 602: * 'filter': (int) One of the filters, e.g. {@see FileConstants}::TYPE_IMAGE
Line 638: if ($options['filter'] == FileConstants::TYPE_IMAGE or strpos(File::mimetype($value), 'image/') === 0) {
Line 1711: * 'filter': (int) One of the filters, e.g. {@see FileConstants}::TYPE_IMAGE

/sprout/Helpers/File.php   Highlighted file source

Line 93: * @return int One of the FileConstants::TYPE_* values, see {@see FileConstants}.
Line 94: * If the type couldn't be determined, FileConstants::TYPE_OTHER is returned.
Line 99: foreach (FileConstants::$type_exts as $type => $exts) {
Line 102: return FileConstants::TYPE_OTHER;
Line 630: $params['type_image'] = GalleryConstants::SOURCE_FILES_IMAGE;
Line 669: return (isset(Constants::$mimetypes[$ext]) ? Constants::$mimetypes[$ext] : 'application/octet-stream');
Line 718: * Constants. Use this with care.
Line 1034: * @param int $file_type The new file type - e.g. DOCUMENT or IMAGE; see FileConstants
Line 1045: case FileConstants::TYPE_DOCUMENT:
Line 1054: case FileConstants::TYPE_IMAGE:

/sprout/Helpers/FileConstants.php   Highlighted file source

Line 18: * A bunch of different constants
Line 20: class FileConstants

/sprout/Helpers/LinkSpecDocument.php   Highlighted file source

Line 17: use Sprout\Helpers\FileConstants;
Line 62: return Form::fileselector($field_name, ['filter' => FileConstants::TYPE_DOCUMENT]);

/sprout/Helpers/Locales/LocaleInfo.php   Highlighted file source

Line 21: use Sprout\Helpers\CountryConstants;
Line 280: $str .= "\n" . CountryConstants::$alpha3[$data['country']];

/sprout/Helpers/Pagenode.php   Highlighted file source

Line 96: if (in_array($name, Constants::$conflict_page_urls)) {

/sprout/Helpers/RteLibraryDocuments.php   Highlighted file source

Line 49: $res = Pdb::query($q, [FileConstants::TYPE_DOCUMENT], 'pdo');
Line 68: $res = Pdb::query($q, [$cat_id, FileConstants::TYPE_DOCUMENT], 'pdo');
Line 104: $params = [FileConstants::TYPE_DOCUMENT];

/sprout/Helpers/RteLibraryImages.php   Highlighted file source

Line 52: $res = Pdb::query($q, [FileConstants::TYPE_IMAGE], 'pdo');
Line 71: $res = Pdb::query($q, [$cat_id, FileConstants::TYPE_IMAGE], 'pdo');
Line 110: $params = [FileConstants::TYPE_IMAGE];

/sprout/Helpers/RteLibrarySounds.php   Highlighted file source

Line 49: $res = Pdb::query($q, [FileConstants::TYPE_SOUND], 'pdo');
Line 68: $res = Pdb::query($q, [$cat_id, FileConstants::TYPE_SOUND], 'pdo');
Line 104: $params = [FileConstants::TYPE_SOUND];

/sprout/Helpers/WorkerRedoSizes.php   Highlighted file source

Line 34: $res = Pdb::query($q, [FileConstants::TYPE_IMAGE], 'pdo');

/sprout/tests/adminPermsTest.php   Highlighted file source

Line 15: use Sprout\Helpers\Constants;
Line 30: ['id' => 1, 'parent_id' => 0, 'admin_perm_type' => Constants::PERM_INHERIT], // top-level, all
Line 31: ['id' => 2, 'parent_id' => 1, 'admin_perm_type' => Constants::PERM_INHERIT], // inherit, all
Line 32: ['id' => 3, 'parent_id' => 1, 'admin_perm_type' => Constants::PERM_SPECIFIC], // no perms
Line 33: ['id' => 4, 'parent_id' => 1, 'admin_perm_type' => Constants::PERM_SPECIFIC], // group 1
Line 34: ['id' => 5, 'parent_id' => 1, 'admin_perm_type' => Constants::PERM_SPECIFIC], // group 2
Line 36: ['id' => 6, 'parent_id' => 0, 'admin_perm_type' => Constants::PERM_SPECIFIC], // top-level, none
Line 37: ['id' => 7, 'parent_id' => 6, 'admin_perm_type' => Constants::PERM_INHERIT], // inherit, none
Line 38: ['id' => 8, 'parent_id' => 6, 'admin_perm_type' => Constants::PERM_SPECIFIC], // specific, group 1
Line 40: ['id' => 9, 'parent_id' => 0, 'admin_perm_type' => Constants::PERM_SPECIFIC], // top-level, group 1
Line 41: ['id' => 10,'parent_id' => 9, 'admin_perm_type' => Constants::PERM_INHERIT], // inherit, group 1
Line 42: ['id' => 11,'parent_id' => 9, 'admin_perm_type' => Constants::PERM_SPECIFIC], // specific, group 2

/sprout/tests/admin_authTest.php   Highlighted file source

Line 15: use Sprout\Helpers\Constants;
Line 24: [Constants::PASSWORD_SHA_SALT],
Line 25: [Constants::PASSWORD_SHA_SALT_5000],
Line 26: [Constants::PASSWORD_BCRYPT12],
Line 69: $this->assertTrue(AdminAuth::checkAlgorithm(Constants::PASSWORD_SHA_SALT));
Line 70: $this->assertTrue(AdminAuth::checkAlgorithm(Constants::PASSWORD_SHA_SALT_5000));

/sprout/views/404_error.php   Highlighted file source

Line 17: use Sprout\Helpers\Constants;
Line 24: <?php echo Sprout::extraPage(Constants::EXTRAPAGES_404); ?>

/sprout/views/admin/categories_navigation.php   Highlighted file source

Line 17: use Sprout\Helpers\Constants;
Line 96: <?php echo Form::dropdown('category_type', ['-wrapper-class' => 'small white', 'placeholder' => 'Archive', 'title' => 'Select whether to show live categories, archived or everything.'], Constants::$category_admin_options); ?>

/sprout/views/admin/file_add_dragdrop_form.php   Highlighted file source

Line 19: use Sprout\Helpers\FileConstants;
Line 72: <?php if ($data['type'] == FileConstants::TYPE_DOCUMENT): ?>
Line 88: <?php if ($data['type'] == FileConstants::TYPE_DOCUMENT and !empty($document_types)): ?>
Line 97: <?php if ($data['type'] == FileConstants::TYPE_IMAGE): ?>
Line 107: <?php if ($data['type'] == FileConstants::TYPE_IMAGE and !empty($shrink_original)): ?>
Line 128: <div class="field-label"><?php echo Enc::html(FileConstants::$type_names[$data['type']]); ?></div>
Line 146: <?php if ($data['type'] == FileConstants::TYPE_SOUND): ?>
Line 152: <?php if ($data['type'] == FileConstants::TYPE_VIDEO): ?>

/sprout/views/admin/file_contents_thumbs.php   Highlighted file source

Line 19: use Sprout\Helpers\FileConstants;
Line 39: if ($row['type'] == FileConstants::TYPE_IMAGE) {
Line 43: if($row['type'] == FileConstants::TYPE_DOCUMENT) {
Line 45: } elseif($row['type'] == FileConstants::TYPE_SOUND) {
Line 47: } elseif($row['type'] == FileConstants::TYPE_VIDEO) {
Line 49: } elseif($row['type'] == FileConstants::TYPE_OTHER) {
Line 54: echo '<div class="image-link__placeholder"><div class="image-link__placeholder__content"><div class="image-link__placeholder__icon icon-before ' . $placeholderIcon . '"></div>', FileConstants::$type_names[$row['type']], '</div></div>';

/sprout/views/admin/file_edit.php   Highlighted file source

Line 21: use Sprout\Helpers\FileConstants;
Line 30: if ($data['type'] == FileConstants::TYPE_IMAGE) {
Line 40: <?php if ($data['type'] == FileConstants::TYPE_IMAGE): ?>
Line 65: <?php if ($data['type'] == FileConstants::TYPE_DOCUMENT): ?>
Line 90: <?php if ($data['type'] == FileConstants::TYPE_IMAGE): ?><th>Image dimensions</th><?php endif; ?>
Line 95: <td><?= Enc::html(FileConstants::$type_names[$data['type']]); ?></td>
Line 96: <?php if ($data['type'] == FileConstants::TYPE_IMAGE): ?><td><?= Enc::html($img_dimensions); ?></td><?php endif; ?>
Line 104: <?php if ($data['type'] == FileConstants::TYPE_IMAGE): ?>
Line 138: <?php elseif ($data['type'] == FileConstants::TYPE_DOCUMENT and $data['plaintext']): ?>
Line 144: <?php if ($data['type'] == FileConstants::TYPE_IMAGE): ?>
Line 219: <p>Replacement file must be of the type <b><?php echo FileConstants::$type_names[$data['type']]; ?></b>.</p>

/sprout/views/admin/page_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Constants;
Line 20: use Sprout\Helpers\FileConstants;
Line 97: echo Form::fileSelector('banner', [], ['filter' => FileConstants::TYPE_IMAGE]);
Line 103: echo Form::fileSelector('gallery_thumb', [], ['filter' => FileConstants::TYPE_IMAGE]);
Line 245: echo Enc::html(Constants::$rev_statuses[$rev['status']]);

/sprout/views/admin/page_menu_groups.php   Highlighted file source

Line 19: use Sprout\Helpers\FileConstants;
Line 61: echo Form::fileselector("extras[{$page_id}][image]", [], ['type' => FileConstants::TYPE_IMAGE]);

/sprout/views/admin/worker_job_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Constants;
Line 84: var status_names = <?= json_encode(Constants::$job_status); ?>;

/sprout/views/advanced_search_form.php   Highlighted file source

Line 18: use Sprout\Helpers\Constants;
Line 42: <?= Form::multiradio('q_type', [], Constants::$search_modifiers); ?>
Line 59: <?= Form::multiradio('tag_type', [], Constants::$search_modifiers); ?>
Line 63: <?= Form::dropdown('date', [], Constants::$relative_dates); ?>

/sprout/views/page_rev_info.php   Highlighted file source

Line 2: use Sprout\Helpers\Constants;
Line 12: <?= Enc::html(Constants::$rev_statuses[$page['status']]); ?>

/sprout/Widgets/AdvancedSearchFormWidget.php   Highlighted file source

Line 16: use Sprout\Helpers\Constants;
Line 51: foreach (Constants::$relative_dates as $idx => $name) {

/sprout/Widgets/AudioWidget.php   Highlighted file source

Line 17: use Sprout\Helpers\FileConstants;
Line 54: return Form::fileselector('filename', [], ['filter' => FileConstants::TYPE_SOUND, 'required' => true]);

/sprout/Widgets/FileListWidget.php   Highlighted file source

Line 16: use Sprout\Helpers\FileConstants;
Line 30: protected $default_settings = ['order' => FileConstants::ORDER_NAME];
Line 84: $out .= Form::dropdown('order', [], FileConstants::$order_names);
Line 114: 'Order' => FileConstants::$order_names[$this->settings['order']],
Line 125: case FileConstants::ORDER_NAME:
Line 128: case FileConstants::ORDER_MANUAL:
Line 131: case FileConstants::ORDER_OLDEST:
Line 134: case FileConstants::ORDER_NEWEST:

/sprout/Widgets/ImageGalleryWidget.php   Highlighted file source

Line 18: use Sprout\Helpers\FileConstants;
Line 217: $cats = Pdb::query($q, [FileConstants::TYPE_IMAGE], 'map');

A total of 212 lines in 45 files were found