Subversion Repositories bysoftdeveloper

[/] [tabs/] [classes/] [interact.php] - Blame information for rev 31

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 31 alvawu
<?php
2
$bysoftdeveloperClassesUrl              = 'bysoftdeveloper/classes';
3
 
4
eZURI::transformURI($bysoftdeveloperClassesUrl, false);
5
 
6
$class_interactcontent = <<<EOT
7
// classes ajax content
8
var developerClassesFormLoaded = false;
9
function bysoftdeveloperShowClassesTab(){
10
    if (developerClassesFormLoaded) {
11
        return true;
12
    }
13
    var data = {action: 'form'};
14
    var options = {url: '$bysoftdeveloperClassesUrl', data:data, callback:bysoftdeveloperUpdateClassesForm};
15
    bysoftdeveloperAjax(options);
16
 
17
 
18
    function bysoftdeveloperUpdateClassesForm(result) {
19
        _get('bysoftdeveloper-classes-form').innerHTML = result;
20
         developerClassesFormLoaded = true;
21
    }
22
}
23
function bysoftdeveloperChangeClass(){
24
    var selectedClass = _get('bysoftdeveloperSelectedClass');
25
    var selectedClass = bysoftdeveloperGetOptionValue(selectedClass);
26
 
27
    if (!selectedClass) return;
28
 
29
    var data = {action: 'content', selectedClass: selectedClass};
30
    var options = {url:'$bysoftdeveloperClassesUrl', data: data, callback: bysoftdeveloperUpdateClassesContent};
31
    bysoftdeveloperAjax(options);
32
 
33
    function bysoftdeveloperUpdateClassesContent(result){
34
        _get('bysoftdeveloper-classes-content').innerHTML = result;
35
    }
36
}
37
// added by Alva
38
var objectcontent_loaded = Array();
39
function bysoftdeveloperObjectList(){
40
    var selectedClass = _get('bysoftdeveloperSelectedClass');
41
    var selectedClass = bysoftdeveloperGetOptionValue(selectedClass);
42
 
43
    if (!selectedClass) return;
44
 
45
    var data = {action: 'object', selectedClass: selectedClass};
46
    var options = {url:'$bysoftdeveloperClassesUrl', data: data, callback: bysoftdeveloperUpdateClassesObjectlistContent};
47
    bysoftdeveloperAjax(options);
48
 
49
    function bysoftdeveloperUpdateClassesObjectlistContent(result){
50
        objectcontent_loaded = Array();
51
        _get('bysoftdeveloper-classes-objectlist').innerHTML = result;
52
    }
53
    return false;
54
}
55
 
56
function bysoftdeveloperObjectContent(object_id){
57
 
58
    if (!object_id) return;
59
 
60
    var data = {action: 'objectcontent', object_id: object_id};
61
    var options = {url:'$bysoftdeveloperClassesUrl', data: data, callback: bysoftdeveloperUpdateClassesObjectContent};
62
    bysoftdeveloperAjax(options);
63
 
64
    function bysoftdeveloperUpdateClassesObjectContent(result){
65
        objectcontent_loaded[object_id] = 1;
66
        _get('bysoftdeveloper-classes-objectcontent-' + object_id).innerHTML = result;
67
    }
68
    return false;
69
}
70
function bysoftdeveloperClassesObjectcontentToggle(object_id){
71
        var ctn = _get('bysoftdeveloper-classes-objectcontent-' + object_id);
72
        if(ctn.style.display == 'none'){
73
                if(objectcontent_loaded[object_id] == null){
74
                        bysoftdeveloperObjectContent(object_id);
75
                }
76
        ctn.style.display = '';
77
   //   console.log(ctn);
78
        ctn.parentNode.style.display = '';
79
    }else{
80
        ctn.style.display = 'none';
81
        ctn.parentNode.style.display = 'none';
82
    }
83
}
84
EOT;
85
return $class_interactcontent;