Changeset 1930

Show
Ignore:
Timestamp:
2006-02-01 20:35:42 (3 years ago)
Author:
ctford
Message:

Displays forms for adding new clip, and hyperlinks to the start of each clip.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Anode/trunk/acidfree/class_annodex.inc

    r1905 r1930  
    7373//FIXME Maybe allow CMML upload? 
    7474function _class_annodex_form($op, &$node, $name_prefix='') { 
     75echo "op is $op"; 
    7576    switch ($op) { 
    7677    case 'new': 
     
    7980        switch ($nailer) { 
    8081        case 'none': 
    81             $output .= form_textfield(t('Annodex width'), $name_prefix.'annodexx', 320, 10, 10); 
    82             $output .= form_textfield(t('Annodex height'), $name_prefix.'annodexy', 240, 10, 10); 
     82            //$output .= form_textfield(t('Annodex width'), $name_prefix.'annodexx', 320, 10, 10); 
     83            //$output .= form_textfield(t('Annodex height'), $name_prefix.'annodexy', 240, 10, 10); 
    8384            break; 
    8485        case 'user': 
     
    99100                break; 
    100101    } 
     102 
     103 
    101104    return $output; 
    102105 
     
    106109} 
    107110 
     111/* 
    108112function _class_annodex_mplayer_options() { 
    109113    $name = 'acidfree_path_to_mplayer'; 
     
    113117    return  form_textfield(t('Path to mplayer'), $name, $mplayer_path, 64, 64); 
    114118} 
    115  
     119*/ 
     120 
     121/* 
    116122function _class_annodex_manipulation_options() { 
    117123    $options = array( 
     
    125131        acidfree_call("_class_annodex_{$value}_options"); 
    126132} 
     133*/ 
    127134 
    128135function theme_acidfree_print_full_annodex(&$node) { 
     
    151158function theme_annodex_control(&$node) { 
    152159 
    153         if(isset($_GET['mode'])) { 
    154                 $mode = $_GET['mode']; 
     160        $arg_name = "media"; 
     161         
     162        if(isset($_GET[$arg_name])) { 
     163                $mode = $_GET[$arg_name]; 
    155164                switch ($mode) { 
    156165                        case "cmml": 
     
    177186                } 
    178187        } else { 
    179                 $output .= "<a href=\"".$_SERVER['REQUEST_URI']."&mode=annodex\">".t('Annodex').'</a><br/>'; 
    180                 $output .= "<a href=\"".$_SERVER['REQUEST_URI']."&mode=theora\">".t('Ogg Theora').'</a><br/>'; 
    181                 $output .= "<a href=\"".$_SERVER['REQUEST_URI']."&mode=cmml\">".t('CMML').'</a><br/>'; 
    182                 return $output; 
     188 
     189                if( $_POST['id'] ) { 
     190                        $result = db_query("INSERT INTO {acidfree_cmml_clips} (`nid`, `a_href`, `a_text`, `img`, `desc`, `start`, `end`, `id`, `track`) VALUES('{$node->nid}', '{$_POST['a_href']}', '{$_POST['a_text']}', '{$_POST['img']}', '{$_POST['desc']}', '{$_POST['start']}', '{$_POST['end']}','{$_POST['id']}', '{$_POST['track']}');");              
     191                } 
     192 
     193                $output .= "<h1>"; 
     194                $output .= l("Annodex", "node/{$node->nid}",NULL,"$arg_name=annodex")." "; 
     195                $output .= l("Ogg Theora", "node/{$node->nid}",NULL,"$arg_name=theora")." "; 
     196                $output .= l("CMML", "node/{$node->nid}",NULL,"$arg_name=cmml")." "; 
     197                $output .= "</h1>"; 
     198                $output .= "<br />"; 
     199 
     200                $result = db_query("SELECT * FROM {acidfree_cmml_clips} WHERE nid={$node->nid};");       
     201 
     202                while( $row = db_fetch_object($result) ) { 
     203                        $output .= l($row->id, "node/{$node->nid}",NULL,"$arg_name=annodex&id={$row->id}")."<br />"; 
     204                } 
     205                $output .= '<form name="clipform" action="?q=node/'.$node->nid.'" method="POST"> 
     206<div> 
     207<br /><br /> 
     208<input name="desc" type="text" size="25" value=""> 
     209<br /> 
     210<input name="id" type="text" size="25" value=""> 
     211<br /> 
     212<input name="start" type="text" size="25" value=""> 
     213<br /><input type="submit" value="Add new clip"><br /> 
     214</div> 
     215</form>'; 
     216                 
     217                 
     218 
     219                $output .= $node->body; 
    183220        } 
    184 
     221 
     222        return $output; 
     223         
     224