-
Notifications
You must be signed in to change notification settings - Fork 0
/
servicefunctions_inc.php
61 lines (55 loc) · 1.76 KB
/
servicefunctions_inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* $Header$
*
* @package nexus
* @subpackage functions
*/
/**
* Nexus edit template service
*/
function nexus_content_edit( $pObject=NULL ) {
global $gBitSmarty;
require_once( NEXUS_PKG_PATH.'Nexus.php' );
$nexus = new Nexus();
$nexusList = $nexus->getMenuList();
$gBitSmarty->assign( 'nexusList', $nexusList );
foreach( $nexusList as $menu ) {
foreach( $menu['items'] as $item ) {
if( !empty( $item['rsrc'] ) && $item['rsrc'] == $pObject->mContentId && $item['rsrc_type'] == 'content_id' ) {
$gBitSmarty->assign( 'inNexusMenu', $menu );
$gBitSmarty->assign( 'inNexusMenuItem', $item['item_id'] );
}
}
}
}
/**
* Nexus preview service
* when we hit preview, we make the selections persistent
*/
function nexus_content_preview( $pObject=NULL ) {
}
/**
* Nexus store service
* store the content as part of an existing menu
*/
function nexus_content_store( $pObject, $pParamHash ) {
global $gBitSystem, $gBitUser, $gBitSmarty;
require_once( NEXUS_PKG_PATH.'Nexus.php' );
$nexus = new Nexus();
if( !empty( $pParamHash['content_id'] ) && !empty( $pParamHash['nexus']['menu_id'] ) ) {
$nexusHash['title'] = $pParamHash['content_store']['title'];
$nexusHash['hint'] = ( !empty( $pParamHash['description'] ) ? $pParamHash['description'] : NULL );
$nexusHash['menu_id'] = $pParamHash['nexus']['menu_id'];
$nexusHash['after_ref_id'] = $pParamHash['nexus']['after_ref_id'];
$nexusHash['rsrc'] = $pParamHash['content_id'];
$nexusHash['rsrc_type'] = 'content_id';
if( !$nexus->storeItem( $nexusHash ) ) {
$gBitSystem->fatalError( "There was an error storing the item: ".vc( $nexus->mErrors ));
}
$nexus->load();
} elseif( !empty( $pParamHash['nexus']['remove_item'] ) ) {
$nexus->expungeItem( $pParamHash['nexus']['remove_item'] );
}
}
?>