+# get all images from admin_images (for cms)
+function admin_pages_get_images() {
+ $out = [];
+ $rows = db_get_assocs('cms_images', 'image,name,caption,sizes', 'order by name, caption, image');
+ if ($rows) {
+ $id = 0;
+ foreach($rows as &$row) {
+ $parts = explode(' ', $row['image'] . ' ', 7);
+ $out[] = [
+ 'id' => '' . $id,
+ 'thumb' => $parts[3],
+ 'image' => $parts[0],
+ 'image_width' => (int)$parts[1],
+ 'image_height' => (int)$parts[2],
+ 'sizes' => $row['sizes'],
+ 'name' => $row['name'],
+ 'caption' => $row['caption']
+ ];
+ $id += 1;
+ } unset($row);
+ }
+ return $out;
+}
+