begin embeddable/shareable design elements (blocks, webpages, layouts, menus, etc.)
This commit is contained in:
@@ -467,4 +467,36 @@ function app_encode($app,$embed = false) {
|
||||
function papp_encode($papp) {
|
||||
return chunk_split(base64_encode(json_encode($papp)),72,"\n");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* install a shared design element (layout, webpage, block, menu, whatever)
|
||||
*
|
||||
*/
|
||||
|
||||
function element_install($channel,$s) {
|
||||
|
||||
$ret = array('success' => false);
|
||||
|
||||
$s = str_replace(array('[element]','[/element]'),array('',''),$s);
|
||||
$s = base64url_decode($s);
|
||||
if(! $s)
|
||||
return $ret;
|
||||
$x = json_decode($s,true);
|
||||
if(! $x)
|
||||
return $ret;
|
||||
|
||||
$d = array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$result = item_store($d);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user