[kde-edu]: edu.kde.org: kvtml files

Ilja iljuss at gmail.com
Sun Oct 14 21:02:56 CEST 2007


Started here: http://lists.kde.org/?l=kde-edu&m=119221981000582&w=2
Replying to: http://lists.kde.org/?l=kde-edu-devel&m=119238389125745&w=2

Well, :

1) There would be some kind of class.

class Data_Files {
  public $files = array();
  function($filename, $description, $last_update, $support_starting_with) {
    $this->files[] = array('description' => $description,
    [..]
  }

  [..]

  function show($application) {
    foreach($this->files as $file) {
      if (??) {
        // show only these files, that application supports
      }
    }
    [..]
  }

  // to use on global page, shows program support stuff too
  $data->show_all();
  /*
  like hangman -  parley
         no        yes
  */
}

2) There would be all data files listed somewhere (some .inc file, maybe).

$data = new Data_Files;
$data->append("dela.tar.bz2",
              "Tarball of German to Latin vocabulary[..]",
              "2006-03-21", ???);

$data->append("lade.tar.bz2",
            "Tarball of Latin to German vocabulary[..]",
            "2005-03-21", ???);
[..]

And on each application page would be shown only supported files:
include("all_data.php");
$data->show(/* Application name */)


But I'm not sure how should it be implemented.

So much as I understand about kvtml support:

(KHangMan == Kanagaram) < KWordQuiz < KVocTrain < Parley

So KWordQuiz should support all files, that Kanagram and KHangMan do,
as so on.

So, maybe one solution would be such, but I'm not sure if it's good
and logical enough:

define (KHANGMAN, 1)
define (KANAGRAM, 1)
define (KWORDQUIZ, 2)
define (KVOCTRAIN, 3)
define (PARLEY, 4);

[..]
$data->append("lade.tar.bz2",
            [..]
            "2005-03-21", KWORDQUIZ); // should mean, that support
                                      // starts with KWordQuiz

// on application page
$data->show(KVOCTRAIN);

[..]

function show($application) {
    foreach($this->files as $file) {
      // KWORDQUIZ = 2               $application = KVOCTRAIN = 3
      if ($file['support_starts_with'] <= $application) {
        // show it then
      }
[..]


Any ideas?
-- 
Ilja


More information about the kde-edu mailing list