Changeset 1083

Show
Ignore:
Timestamp:
08/28/06 19:07:33 (7 years ago)
Author:
max-horvath
Message:

"2006-08-28 Benoit Gregoire <bock@…>

Location:
trunk/wifidog-auth
Files:
2 added
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/CHANGELOG

    r1082 r1083  
     12006-08-28 Benoit Grégoire  <bock@step.polymtl.ca> 
     2        * Add SimplePicture content type 
     3        * Fix #225 (For both nodes and networks) 
     4         
    152006-08-28 Max Horváth <max.horvath@maxspot.de> 
    26        * Integrated KML node list export 
  • trunk/wifidog-auth/wifidog/classes/Content/Langstring/Langstring.php

    r1080 r1083  
    129129 
    130130            if ($row == null) { 
    131                 $retval = sprintf(_("(Empty $s)"), get_class($this)); 
     131                $retval = sprintf(_("(Empty %s)"), get_class($this)); 
    132132            } else { 
    133133                $retval = $row['value']; 
  • trunk/wifidog-auth/wifidog/classes/Content/TrivialLangstring/TrivialLangstring.php

    r1031 r1083  
    5050 
    5151/** 
    52  * Represents a trivial Langstring (no title, description, etc.) 
     52 * Represents a simple Langstring (no title, description, etc.) 
    5353 * 
    5454 * @package    WiFiDogAuthServer 
  • trunk/wifidog-auth/wifidog/classes/Network.php

    r1070 r1083  
    12371237        $html .= "<legend>"._("Network management")."</legend>\n"; 
    12381238        $html .= "<ul class='admin_element_list'>\n"; 
     1239 
     1240        // Content management 
     1241        $title = _("Network content"); 
     1242        $name = "network_".$this->id."_content"; 
     1243        $data = Content :: getLinkedContentUI($name, "network_has_content", "network_id", $this->id, $display_page = "portal"); 
     1244        $html .= InterfaceElements :: generateAdminSectionContainer("network_content", $title, $data); 
     1245 
    12391246        // network_id 
    12401247        $html .= "<li class='admin_element_item_container'>\n"; 
     
    12431250        $value = htmlspecialchars($this->getId(), ENT_QUOTES); 
    12441251        $html .= $value; 
    1245         $html .= "</div>\n"; 
    1246         $html .= "</li>\n"; 
    1247  
    1248         // creation_date 
    1249         $name = "network_".$this->getId()."_creation_date"; 
    1250         $value = htmlspecialchars($this->getCreationDate(), ENT_QUOTES); 
    1251  
    1252         $html .= "<li class='admin_element_item_container'>\n"; 
    1253         $html .= "<div class='admin_element_label'>"._("Network creation date").":</div>\n"; 
    1254         $html .= "<div class='admin_element_data'>\n"; 
    1255         $html .= "<input type='text' size ='50' value='$value' name='$name'>\n"; 
    12561252        $html .= "</div>\n"; 
    12571253        $html .= "</li>\n"; 
     
    12671263        $html .= "</li>\n"; 
    12681264 
     1265        // creation_date 
     1266        $name = "network_".$this->getId()."_creation_date"; 
     1267        $value = htmlspecialchars($this->getCreationDate(), ENT_QUOTES); 
     1268 
     1269        $html .= "<li class='admin_element_item_container'>\n"; 
     1270        $html .= "<div class='admin_element_label'>"._("Network creation date").":</div>\n"; 
     1271        $html .= "<div class='admin_element_data'>\n"; 
     1272        $html .= "<input type='text' size ='50' value='$value' name='$name'>\n"; 
     1273        $html .= "</div>\n"; 
     1274        $html .= "</li>\n"; 
     1275         
    12691276        // homepage_url 
    12701277        $html .= "<li class='admin_element_item_container'>\n"; 
     
    14401447        $html .= "</li>\n"; 
    14411448 
    1442         // Content management 
    1443         $title = _("Network content"); 
    1444         $name = "network_".$this->id."_content"; 
    1445         $data = Content :: getLinkedContentUI($name, "network_has_content", "network_id", $this->id, $display_page = "portal"); 
    1446         $html .= InterfaceElements :: generateAdminSectionContainer("network_content", $title, $data); 
    14471449        $html .= "</ul>\n"; 
    14481450        $html .= "</fieldset>\n"; 
     
    14581460            throw new Exception(_('Access denied!')); 
    14591461        } 
    1460  
     1462         
     1463        // Content management 
     1464        $name = "network_".$this->id."_content"; 
     1465        Content :: processLinkedContentUI($name, 'network_has_content', 'network_id', $this->id); 
     1466 
     1467        // name 
     1468        $name = "network_".$this->getId()."_name"; 
     1469        $this->setName($_REQUEST[$name]); 
     1470         
    14611471        // creation_date 
    14621472        $name = "network_".$this->getId()."_creation_date"; 
    14631473        $this->setCreationDate($_REQUEST[$name]); 
    1464  
    1465         // name 
    1466         $name = "network_".$this->getId()."_name"; 
    1467         $this->setName($_REQUEST[$name]); 
    14681474 
    14691475        // homepage_url 
     
    15351541            header("Location: {$url}"); 
    15361542        } 
    1537         // Content management 
    1538         $name = "network_".$this->id."_content"; 
    1539         Content :: processLinkedContentUI($name, 'network_has_content', 'network_id', $this->id); 
    15401543    } 
    15411544 
  • trunk/wifidog-auth/wifidog/classes/Node.php

    r1070 r1083  
    810810                $_html_node_information[] = InterfaceElements::generateAdminSectionContainer("node_id", $_title, $_data); 
    811811 
    812                 // Creation date 
    813                 $_title = _("Creation date"); 
    814                 if ($_userIsAdmin) { 
    815             $_data = DateTime::getSelectDateTimeUI(new DateTime($this->getCreationDate()), "node_" . $hashed_node_id . "_creation_date", DateTime::INTERFACE_DATETIME_FIELD, "node_creation_date_input"); 
    816                 } else { 
    817             $_data  = htmlspecialchars($this->getCreationDate(), ENT_QUOTES); 
    818                 $_data .= InterfaceElements::generateInputHidden("node_" . $hashed_node_id . "_creation_date", $this->getCreationDate()); 
    819                 } 
    820                 $_html_node_information[] = InterfaceElements::generateAdminSectionContainer("node_creation_date", $_title, $_data); 
    821  
    822                 // Name 
     812        //Node content 
     813        $_html_content = array(); 
     814        $_title = _("Node content"); 
     815        $_data = Content::getLinkedContentUI("node_" . $hashed_node_id . "_content", "node_has_content", "node_id", $this->id, "portal"); 
     816        $html .= InterfaceElements::generateAdminSectionContainer("node_content", $_title, $_data); 
     817  
     818                // Name 
    823819                $_title = _("Name"); 
    824820                $_data = InterfaceElements::generateInputText("node_" . $hashed_node_id . "_name", $this->getName(), "node_name_input"); 
    825821                $_html_node_information[] = InterfaceElements::generateAdminSectionContainer("node_name", $_title, $_data); 
     822 
     823        // Creation date 
     824        $_title = _("Creation date"); 
     825        if ($_userIsAdmin) { 
     826            $_data = DateTime::getSelectDateTimeUI(new DateTime($this->getCreationDate()), "node_" . $hashed_node_id . "_creation_date", DateTime::INTERFACE_DATETIME_FIELD, "node_creation_date_input"); 
     827        } else { 
     828            $_data  = htmlspecialchars($this->getCreationDate(), ENT_QUOTES); 
     829            $_data .= InterfaceElements::generateInputHidden("node_" . $hashed_node_id . "_creation_date", $this->getCreationDate()); 
     830        } 
     831        $_html_node_information[] = InterfaceElements::generateAdminSectionContainer("node_creation_date", $_title, $_data); 
    826832 
    827833                // Description 
     
    984990                $html .= InterfaceElements::generateAdminSectionContainer("node_access_rights", _("Access rights"), implode(null, $_html_access_rights)); 
    985991 
    986                 /* 
    987                  * Node content 
    988                  */ 
    989                 $_html_content = array(); 
    990  
    991                 // Node content 
    992                 $_title = _("Node content"); 
    993                 $_data = Content::getLinkedContentUI("node_" . $this->id . "_content", "node_has_content", "node_id", $this->id, "portal"); 
    994                 $_html_content[] = InterfaceElements::generateAdminSectionContainer("node_content", $_title, $_data); 
    995  
    996                 // Build section 
    997                 $html .= InterfaceElements::generateAdminSectionContainer("node_content", _("Node content"), implode(null, $_html_content)); 
    998  
    999992                $html .= "</ul>\n"; 
    1000993                $html .= "</fieldset>"; 
     
    10211014                // Hashed node_id (this is a workaround since PHP auto-converts HTTP vars var periods, spaces or underscores ) 
    10221015                $hashed_node_id = md5($this->getId()); 
     1016       // Content processing 
     1017        $name = "node_{$hashed_node_id}_content"; 
     1018        Content::processLinkedContentUI($name, 'node_has_content', 'node_id', $this->id); 
    10231019 
    10241020                // Name 
     
    10301026                } 
    10311027 
    1032                 // Creation date 
     1028                // Creation date 
    10331029                if ($_userIsAdmin) { 
    10341030                $name = "node_".$hashed_node_id."_creation_date"; 
     
    12041200                } 
    12051201 
    1206                 // Content processing 
    1207                 $name = "node_{$this->id}_content"; 
    1208                 Content::processLinkedContentUI($name, 'node_has_content', 'node_id', $this->id); 
    1209  
    1210                 // Name 
     1202                // Id 
    12111203                $name = "node_".$hashed_node_id."_id"; 
    12121204                $this->setId($_REQUEST[$name]);