[MODULE] phundament 2

Oh b8 looks really nice ;) it should be Yii showcase of CMS realisation ;-D

Small typos:

http://localhost/p2b8/www/en_us/demo/category/show?id=1

should be http://localhost/p2b8/www/en_us/demo/category/view?id=1

And beloved classic style theme needs to be fixed ;) (screen captures above)

  • Contact page is working again :D

Themes looks REALLY MUCH PROMISING ! Nice WORK!

All to all, can’t wait to see the first stable Phundament2 :wink:

Best regards,

CoLT

Here’s the “official” annoucement with some screenshots for the lazy ones ;)

[size="4"]phundament 2.1 beta 8 released[/size]

News from the dev-dungeons: Super CRUDs

[urgent]

Why I can’t use JUI date picker extension under Phundament2?

Simple code:


<?php

             $this->widget('application.extensions.jui.EDatePicker',

              array(

                    'name'=>'dpa',

                    'language'=>'es',

               //     'mode'=>'button',

                    'theme'=>'cupertino',

                                        'fontSize'=>'0.8em',

                    'value'=>date('Y-m-d'),

             //       'htmlOptions'=>array('size'=>10)

                   )

             );

             ?>

It works under Yii testdrive :)

Extension here

Regards,

CoLT

Maybe because of jQuery 1.4.

Try using the zii CJuiDatePicker.

Yeah, might be :)

I like the ‘mode’ parameter, like


                    'mode'=>'imagebutton',

but zii CJuiDatePicker does not support it.

You could also override your scriptMap


        'clientScript'=>array(

            'class' => 'CClientScript',

            'scriptMap' => array(

              'jquery-ui.min.js' => '/themes/classic/jquery/jquery-ui-1.7.2.custom.min.js',

              'jquery.min.js' => '/themes/classic/jquery/jquery-1.3.2.min.js',

            ),

        )



But this may lead to other problems, I had many issues with jQuery 1.3/1.4 CAutoComplete and CJuiDialog.

You have to check the logs in Firebug, application.log or apache logs then.

a) Can you list the files here C:\wamp\www\p2b7\data\fonts\gw-fonts-ttf-1.0\CasUni\CaslonRoman

B) try using another font

Also like in 2.1, check the logs.

Use render & direct download for debugging.

Hmmm, got to check this, but should be a PDFlib issue (hopefully).

You can set the license file like:


$this->_manager = new EPdfManager;

$this->_manager->licenseFile = Yii::getPathOfAlias('mylicense').DS.'pdflib.license';        



or directly in lithron, see http://wiki.lithron.de/faq (in German, but should be no problem.

Can you also check the logs and also lithron logs, they should be in the job folder and or the render page (in demo)

http://tweetphoto.com/21329691

Also logs … haven’t ever tested lithron on Windows.

Best regards,

schmunk

Huh, pretty large thread now.

I invite everyone also to post your questions here: http://groups.google.com/group/phundament-dev/

Yep ;) Good things grow fast :))

Now one more issue, I can’t use Simple Jui widgets with Phundament2… Like datePicker

And Yii’s Zii does work with Phundament but I can’t usr CClipWidget like:


<?php $this->beginWidget('system.web.widgets.CClipWidget', array('id'=>'test')); ?>

<ul>

	<li>test;</li>

</ul>

<?php $this->endWidget(); ?>

Thanks,

CoLT

I18N

C:\wamp\www\ssisb8\models\LoginForm.php add 39-40 lines


			'username'=> Yii::t('P2Module.p2','username'),

			'password'=> Yii::t('P2Module.p2','password'),

[edit]

ALSO

Page widget management should firstly offer to edit Data(e.g.HTML), then Edit Widget (User comfortability)

Greetings,

CoLT

Added TODO issue with SRBAC:

Controller extends SBaseController to Autocreate Auth Items.

[s]Add p2b8\components\Controller.php

[size="1"]<?php

/**

  • Controller is the customized base controller class.

  • All controller classes for this application should extend from this base class.

*/

class Controller extends SBaseController

{

/**


 * @var string the default layout for the controller view. Defaults to 'column1',


 * meaning using a single column layout. See 'protected/views/layouts/column1.php'.


 */


public &#036;layout='column1';


/**


 * @var array context menu items. This property will be assigned to {@link CMenu::items}.


 */


public &#036;menu=array();


/**


 * @var array the breadcrumbs of the current page. The value of this property will


 * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links}


 * for more details on how to specify this property.


 */


public &#036;breadcrumbs=array();

}[/size]

[/s]

Edit p2b8\controllers\Controller.php


3 class Controller extends SBaseController {

Edit p2b8\config\main.php


   // autoloading model and component classes

    'import'=>array(

...

        'application.modules.srbac.controllers.SBaseController'

        

    ),

[edit]

New to srbac users may refer to Yii blog demo with srbac

Best regards,

CoLT

[question]

How to add Page, menu link accessible only for Members [the right way]?

Thanks

CoLT

You have to use the checkAccess dropdown available from P2InfoInputWidget, now in the right sidebar in the CRUDs (files, html, pages).

see also http://code.google.com/p/phundament/wiki/UsersAndRoles

btw: phundament 2.1 beta 9 released fixes several bugs.

[opinion]

I believe it would be more compact and flexible to change Admin’s top tool bar to be auto-hidden by default, and show up only on mouse over. Or like Yii Debug Tool bar (small icon which extends then clicked).

What do you think?

CoLT

[Lithron ext]

SVN rev.140 (p2b9)

In WAMP (@WIN XP) I got problems with getting right fonts:


PDFlibException

Description


Font 'C:\wamp\www\p2b9\data\fonts\gw-fonts-ttf-1.0\CasUni\CaslonRoman' with encoding 'unicode': Font file (AFM, PFM, TTF, OTF etc.) or host font not found

Source File


C:\wamp\www\p2b9\lib\lithron\Lithron.php(321)


00309:             }

00310:             $this->Fonts[$family][$subtype]["spacewidth"] = $this->DummyPDF->stringwidth(" ", $handle, 1);

00311:         }

00312:     }

00313: 

00314:     public function getFontHandle($pdf, $handlekey, $family, $subtype)

00315:     {

00316:         $f = $this->Fonts[$family][$subtype];

00317:         if (!isset($f[$handlekey]))

00318:         {

00319:             $emb = isset($f["embedding"]) ? $f["embedding"] : "false";

00320:             $enc = isset($f["encoding"]) ? $f["encoding"] : $this->DefaultEncoding;

00321: $handle = $pdf->load_font($f["name"], $enc, "embedding={".$emb."}");

00322:             $this->Fonts[$family][$subtype][$handlekey] = $handle;

00323:         }

00324:         else

00325:         $handle = $f[$handlekey];

00326:         return $handle;

00327:     }

00328: 

00329: 

00330:     public function getStringWidth($node, $string)

00331:     {

00332:         $family = Property::get($node, "font-family");

00333:         $weight = Property::get($node, "font-weight");


Stack Trace


#0 C:\wamp\www\p2b9\lib\lithron\Lithron.php(321): PDFlib->load_font('C:\wamp\www\p2b...', 'unicode', 'embedding={true...')

#1 C:\wamp\www\p2b9\lib\lithron\Lithron.php(303): Lithron->getFontHandle(Object(PDFlib), 'dummyhandle', 'junicode', 'normal')

#2 C:\wamp\www\p2b9\lib\lithron\Lithron.php(119): Lithron->initializeFonts()

#3 C:\wamp\www\p2b9\modules\p2\extensions\pdf\EPdfManager.php(97): Lithron->init()

#4 C:\wamp\www\p2b9\modules\p2\extensions\pdf\EPdfRenderAction.php(49): EPdfManager->renderJob()

#5 C:\wamp\www\p2b9\lib\yii\web\CController.php(300): EPdfRenderAction->run()

#6 C:\wamp\www\p2b9\lib\yii\web\filters\CFilterChain.php(129): CController->runAction(Object(EPdfRenderAction))

#7 C:\wamp\www\p2b9\lib\yii\web\filters\CFilter.php(41): CFilterChain->run()

#8 C:\wamp\www\p2b9\lib\yii\web\CController.php(999): CFilter->filter(Object(CFilterChain))

#9 C:\wamp\www\p2b9\lib\yii\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain))

#10 C:\wamp\www\p2b9\lib\yii\web\filters\CFilterChain.php(126): CInlineFilter->filter(Object(CFilterChain))

#11 C:\wamp\www\p2b9\lib\yii\web\CController.php(283): CFilterChain->run()

#12 C:\wamp\www\p2b9\lib\yii\web\CController.php(257): CController->runActionWithFilters(Object(EPdfRenderAction), Array)

#13 C:\wamp\www\p2b9\lib\yii\web\CWebApplication.php(320): CController->run('renderPdf')

#14 C:\wamp\www\p2b9\lib\yii\web\CWebApplication.php(120): CWebApplication->runController('p2/ajax/renderP...')

#15 C:\wamp\www\p2b9\lib\yii\base\CApplication.php(135): CWebApplication->processRequest()

#16 C:\wamp\www\p2b9\www\index.php(13): CApplication->run()

#17 {main}




problem somewhere here \p2b9\modules\p2\views\pdfTemplates\test.php


	<font font-family="junicode"

		file-normal="<?php echo Yii::app()->basePath.DS."data".DS."fonts".DS."gw-fonts-ttf-1.0".DS."CasUni".DS."CaslonRoman" ?>"

        embedding-normal="true"

        file-bold="<?php echo Yii::app()->basePath.DS."data".DS."fonts".DS."gw-fonts-ttf-1.0".DS."CasUni".DS."CaslonBold" ?>"

		embedding-bold="true"

		file-italic="<?php echo Yii::app()->basePath.DS."data".DS."fonts".DS."gw-fonts-ttf-1.0".DS."CasUni".DS."CaslonBold" ?>"

		embedding-italic="true"

		file-oblique="<?php echo Yii::app()->basePath.DS."data".DS."fonts".DS."gw-fonts-ttf-1.0".DS."CasUni".DS."CaslonItalic" ?>"

		embedding-oblique="true"

	/>

Nevertheless not including fonts renders test.php except Flash Preview windows:


Error: HTTP request error

Greetings,

CoLT

I also thought about it. Would be cool to have a common style or layout to include module-menus.

Do you have an example for “Yii Debug Tool bar” - never saw that :)

to be continued here … http://groups.google.com/group/phundament-dev/browse_frm/thread/1833b253099fb1c2

Oh its very handy ext here

If combine admin tool bar with this one (yiidebugtb) - great things would be on the dev’s hands! :)

YiiDebugTB (3 views, minimized, opened, extended):

695

yiidebugtb.PNG

Greetings,

CoLT

[solved]

I created a custom widget to embed Youtube videos,

And I see limits are set to custom text fields that I can not paste full embed code:

e.g.


<object width="500" height="405"><param name="movie" value="http://www.youtube.com/v/gDDO3ob-4ZY&hl=en_US&fs=1&color1=0x234900&color2=0x4e9e00&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/gDDO3ob-4ZY&hl=en_US&fs=1&color1=0x234900&color2=0x4e9e00&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="405"></embed></object>

I get to:


<object width="500" height="405"><param name="movie" value="http://www.youtube.com/v/gDDO3ob-4ZY&hl=en_US&fs=1&color1=0x234900&color2=0x4e9e00&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="alwa



What’s the best way to fix it?

[edit]

I kind of feeling making a bike invention :D but… I have sliced the code it to parts and it works for now. I couldn’t get CKEditor Embed plugin working right for some reason.

If anyone needs fast implementation, YoutubeWidged (don’t forget to add in the main.php config):




<?php


/**

 * Description of YoutubeWidget goes here

 */


class YoutubeWidget extends CWidget{

    

    public $width='500';

    public $height='405';

    public $movie='';

    public $other_params='<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>';


    function init() {

        

    }

    function run(){

 				echo '<br/>';

 				echo '<object width="'.$this->width.'" height="'.$this->height.'">';

 				echo '<param name="movie" value="'.$this->movie.'"></param>';

				echo $this->other_params;

				echo '<embed src="'.$this->movie.'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'.$this->width.'" height="'.$this->height.'"></embed>';

				echo '</object>';

				echo '<br/>';

    }

}

?>



Now you have to add movie link from Youtube generated Embed code, e.g.


http://www.youtube.com/v/gDDO3ob-4ZY&hl=en_US&fs=1&color1=0x234900&color2=0x4e9e00&border=1

Any better ideas would be greatly accepted.

One of:

Just add a Embed code (Youtube generated) to your HTML created widget viewing the source(button).

Greetings,

CoLT