1 | <?php |
||
9 | class Image extends File implements ShortcodeHandler { |
||
10 | |||
11 | public function __construct($record = null, $isSingleton = false, $model = null, $queryParams = array()) { |
||
12 | parent::__construct($record, $isSingleton, $model, $queryParams); |
||
13 | $this->File->setAllowedCategories('image/supported'); |
||
14 | } |
||
15 | |||
16 | public function getCMSFields() { |
||
24 | |||
25 | public function getIsImage() { |
||
28 | |||
29 | /** |
||
30 | * Replace"[image id=n]" shortcode with an image reference. |
||
31 | * Permission checks will be enforced by the file routing itself. |
||
32 | * |
||
33 | * @param array $args Arguments passed to the parser |
||
34 | * @param string $content Raw shortcode |
||
35 | * @param ShortcodeParser $parser Parser |
||
36 | * @param string $shortcode Name of shortcode used to register this handler |
||
37 | * @param array $extra Extra arguments |
||
38 | * @return string Result of the handled shortcode |
||
39 | */ |
||
40 | public static function handle_shortcode($args, $content, $parser, $shortcode, $extra = array()) { |
||
85 | |||
86 | /** |
||
87 | * Regenerates "[image id=n]" shortcode with new src attribute prior to being edited within the CMS. |
||
88 | * |
||
89 | * @param array $args Arguments passed to the parser |
||
90 | * @param string $content Raw shortcode |
||
91 | * @param ShortcodeParser $parser Parser |
||
92 | * @param string $shortcode Name of shortcode used to register this handler |
||
93 | * @param array $extra Extra arguments |
||
94 | * @return string Result of the handled shortcode |
||
95 | */ |
||
96 | public static function regenerate_shortcode($args, $content, $parser, $shortcode, $extra = array()) { |
||
111 | |||
112 | /** |
||
113 | * Helper method to regenerate all shortcode links. |
||
114 | * |
||
115 | * @param string $value HTML value |
||
116 | * @return string value with links resampled |
||
117 | */ |
||
118 | public static function regenerate_html_links($value) { |
||
123 | } |
||
124 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: