diff options
Diffstat (limited to 'frontend/modules')
-rw-r--r-- | frontend/modules/gentoo/step1.php | 30 | ||||
-rw-r--r-- | frontend/modules/gentoo/step2.php | 110 | ||||
-rw-r--r-- | frontend/modules/gentoo/step3.php | 29 | ||||
l--------- | frontend/modules/gentoo_catalyst | 1 | ||||
l--------- | frontend/modules/gentoo_portage | 1 |
5 files changed, 27 insertions, 144 deletions
diff --git a/frontend/modules/gentoo/step1.php b/frontend/modules/gentoo/step1.php index 20899bb..d3ee3b9 100644 --- a/frontend/modules/gentoo/step1.php +++ b/frontend/modules/gentoo/step1.php @@ -1,24 +1,12 @@ <?php -function gentoo_init_step1() { - return array('title' => 'Step 1 - Choose Profile'); -} -function gentoo_body_step1() { - global $S; - $configuration=&$S['wizard.configuration']; - //$opts=$configuration->get_configopts(); // TODO use this to set selected="selected" on the current profile - echo 'Profile: <select name="profileid">'; - $r=$S['pdo']->query('SELECT * FROM `gentoo_profiles` WHERE `flags` NOT LIKE "%d%"'); // d for disabled - while ($profile=$r->fetch(PDO::FETCH_ASSOC)) { - $profile=new sql_gentoo_profile($profile); - $display=$profile->name?$profile->name:($profile->pkgdir?$profile->pkgdir:'/'); - echo '<option value="'.$profile->id.'">'.htmlentities($display).'</option>'; - } - echo '</select><br/>'; -} -function gentoo_process_step1() { - global $S, $request; - $profile=new sql_gentoo_profile($request['profileid']); - $profileopt=new sql_configopt($S['wizard.configuration']->id, 'profile', $profile->id); - $profileopt->write(); +$title='Choose Profile'; +$opts=array(); +$r=$this->query('SELECT * FROM `gentoo_profiles` WHERE `flags` NOT LIKE "%d%"'); +while ($profile=$r->fetch(PDO::FETCH_ASSOC)) { + $profile=new sql_gentoo_profile($profile); + $display=$profile->name?$profile->name:($profile->pkgdir?$profile->pkgdir:'/'); + $opts[$profile->id]=$display; } +$this->select('profile', 'profile', 'Profile', $opts); +$next=2; ?> diff --git a/frontend/modules/gentoo/step2.php b/frontend/modules/gentoo/step2.php index c800a5d..9ca5ee7 100644 --- a/frontend/modules/gentoo/step2.php +++ b/frontend/modules/gentoo/step2.php @@ -1,111 +1,9 @@ <?php -function gentoo_init_step2() { - $js=<<<JS -function tog_show_pkgs(lc) { - var div=document.getElementById('lc-'+lc); - if (div.style.display == "none") { - div.style.display=""; - } else { - div.style.display="none"; - } -} -var oldq=null; -function packagesearch(entry) { - var q=entry.value; - if (q !== oldq) { - filter_packages_by(q); - } - oldq=q; -} -function filter_packages_by(q) { - var plist=document.getElementById('plist'); - var tfound=0; - for (i=0; i<plist.childNodes.length; i++) { - var bc=plist.childNodes[i]; - if (bc.className !== 'bc') { - continue; - } - var bcid=bc.id.substr(3); - var bfound=0; - for (j=0; j<bc.childNodes.length; j++) { - var lc=bc.childNodes[j]; - if (lc.className !== 'lc') { - continue; - } - var lcid=lc.id.substr(3, lc.id.length-3); - var found=0; - for (k=0; k<lc.childNodes.length; k++) { - var p=lc.childNodes[k]; - if (!p.className || p.className.substr(0,3) !== 'pkg') { - continue; - } - if (q == '') { - p.style.display=""; - } else { - var name=''; - for (l=0; l<p.childNodes.length; l++) { - var d=p.childNodes[l]; - if (d.className == 'pd') { - name=d.innerHTML; - break; - } - } - if (name && name.toLowerCase().indexOf(q.toLowerCase()) != -1) { - p.style.display=""; - found++; - } else { - p.style.display="none"; - } - } - } - if (q == "" || found == 0) { - lc.style.display="none"; - document.getElementById('lct-'+lcid).style.display=(q == ''?"":"none"); - } else { - bfound+=found; - lc.style.display=""; - document.getElementById('lct-'+lcid).style.display=""; - } - } - if (q=="" || bfound > 0) { - document.getElementById('bct-'+bcid).style.display=""; - } else { - document.getElementById('bct-'+bcid).style.display="none"; - } - tfound+=bfound; - } - document.getElementById('zero').style.display=(tfound || !q.length?'none':''); -} -JS; - $css=<<<CSS -#plist { - height: 25em; - overflow: auto; -} -#plist a { - text-decoration: none; -} -div.masked { - color: red; -} -div.bct { - font-size: 125%; -} -div.lct { - font-size: 110%; -} -div.bc, div.lc { - padding-left: 2em; -} -.pd { - cursor: pointer; -} -CSS; - return array('title' => 'Step 2 - Choose Extra Packages', 'head_scripts' => array($js), 'head_css' => array($css)); -} +$title='Choose Extra Packages'; +$scripts='pkgsearch'; function gentoo_body_step2() { global $S; - $configuration=&$S['wizard.configuration']; + $configuration=&$S['wizard']['configuration']; $opts=$configuration->get_configopts(); $profile=new sql_gentoo_profile($opts['profile']); $bcs=$profile->get_packages(); @@ -136,7 +34,7 @@ function gentoo_process_step2() { $packages[]='='.$name; } $packages=implode(' ', $packages); - $opt=new sql_configopt($S['wizard.configuration']->id, 'install_packages', $packages); + $opt=new sql_configopt($S['wizard']['configuration']->id, 'install_packages', $packages); $opt->write(); } } diff --git a/frontend/modules/gentoo/step3.php b/frontend/modules/gentoo/step3.php index 2f66325..9dd523a 100644 --- a/frontend/modules/gentoo/step3.php +++ b/frontend/modules/gentoo/step3.php @@ -1,18 +1,13 @@ <?php -function gentoo_init_step3() { - return array('title' => 'Step 3 - Image Format'); -} -function gentoo_body_step3() { - echo 'Image type: <select name="image_type"><option value="tgz">Tar/Gzip</option><option value="tbz2">Tar/Bzip2</option><option value="installcd">Installer CD with Tar/Bzip2 image</option><option value="livecd">LiveCD</option><option value="ext2">ext2</option><option value="jffs2">jffs2</option></select><br/>'; -} -function gentoo_process_step3() { - global $S, $request; - if (isset($request['image_type'])) { - debug('wizard', 'step3: image type='.$request['image_type']); - $opt=new sql_configopt($S['wizard.configuration']->id, 'image_type', $request['image_type']); - $opt->write(); - } else { - debug('wizard', 'step3: no image_type variable'); - } - return true; -} +// TODO This shouldn't be a step at all, it should be in wizard.php to choose between output modules +$title='Image Format'; +$this->select('image_type', 'image_type', 'Image type', array( + 'tgz' => 'Tar/Gzip', + 'tbz2' => 'Tar/Bzip2', + 'installcd' => 'Installer CD with Tar/Bzip2', + 'livecd' => 'LiveCD', + 'ext2' => 'ext2', + 'jffs2' => 'jffs2' +)); +$next=null; +?> diff --git a/frontend/modules/gentoo_catalyst b/frontend/modules/gentoo_catalyst new file mode 120000 index 0000000..0c0273e --- /dev/null +++ b/frontend/modules/gentoo_catalyst @@ -0,0 +1 @@ +gentoo
\ No newline at end of file diff --git a/frontend/modules/gentoo_portage b/frontend/modules/gentoo_portage new file mode 120000 index 0000000..0c0273e --- /dev/null +++ b/frontend/modules/gentoo_portage @@ -0,0 +1 @@ +gentoo
\ No newline at end of file |