Subversion Repositories bysoftdeveloper

[/] [modules/] [bysoftdeveloper/] [classes.php] - Blame information for rev 31

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 10 cavin.deng
<?php
2
 
3
include_once( 'kernel/common/template.php' );
4
 
5 11 cavin.deng
// total disabled translation for this project.
6
$ini = eZINI::instance();
7
$ini->setVariable('RegionalSettings', 'TextTranslation', 'disabled');
8
 
9 31 alvawu
// Authorize the user to admin when doing fetch
10
$current_user = eZUser::currentUser ();
11
$admin = eZUser::fetch($ini->variable('BysoftDeveloper', 'AdminID'));
12
SwitchUser::switchTo($admin);
13
 
14 10 cavin.deng
$tpl = templateInit();
15
$http = eZHTTPTool::instance();
16
 
17
if ($http->postVariable('action') == 'form') {
18
 
19
    $groups = eZContentClassGroup::fetchList(false, true);
20
 
21
    $template = 'design:bysoftdeveloper/classes/form.tpl';
22
    $tpl->setVariable('groups', $groups);
23
    echo $tpl->fetch($template);
24
}
25
 
26
if ($http->postVariable('action') == 'content') {
27
 
28 31 alvawu
    $class_id = $http->postVariable('selectedClass');
29 10 cavin.deng
 
30 31 alvawu
    $class = eZContentClass::fetch($class_id);
31 10 cavin.deng
 
32
    $attributes = $class->fetchAttributes();
33
 
34
    eZDataType::loadAndRegisterAllTypes();
35
 
36
    $datatypes = eZDataType::registeredDataTypes();
37 31 alvawu
    $count = eZContentObject::fetchListCount(array('contentclass_id' => $class_id));
38 10 cavin.deng
 
39 31 alvawu
    $tpl->setVariable('count', $count);
40 10 cavin.deng
    $tpl->setVariable('class', $class);
41
    $tpl->setVariable('attributes', $attributes);
42
    $tpl->setVariable('datatypes', $datatypes );
43
 
44
    $template = 'design:bysoftdeveloper/classes/content.tpl';
45
    echo $tpl->fetch($template);
46
 
47
}
48
 
49 31 alvawu
 
50
if ($http->postVariable('action') == 'object') {
51
 
52
    $class_id = $http->postVariable('selectedClass');
53
    $class = eZContentClass::fetch($class_id);
54
 
55
    $contentobject_list = eZContentObject::fetchList(true,  array('contentclass_id' => $class_id));
56
 
57
  //  $tpl->setVariable('class_identifier', $classIdentifier);
58
        $tpl->setVariable('contentobject_list', $contentobject_list);
59
 
60
    $template = 'design:bysoftdeveloper/classes/object.tpl';
61
    echo $tpl->fetch($template);
62
 
63
}
64
 
65
if ($http->postVariable('action') == 'objectcontent') {
66
 
67
    $object_id = $http->postVariable('object_id');
68
        $object = eZContentObject::fetch($object_id);
69
 
70
    $tpl->setVariable('object', $object);
71
 
72
 
73
    $template = 'design:bysoftdeveloper/classes/objectcontent.tpl';
74
    echo $tpl->fetch($template);
75
 
76
}
77
SwitchUser::switchTo($current_user);
78 10 cavin.deng
eZExecution::cleanExit();;
79
 
80
?>