[MODULE] phundament 2

[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

Are you using <input> or <textarea>?

Maybe you can post a .zip of your widget?

Right, text area would help here, where do I specify it?

CoLT

You could either create a custom widget extended from P2BaseWidget, see p2/widgets/skeleton/P2SkeletonWidget.php

The advantage would be, that you can use a custom _form.php view there.

Within this view make sure you surround every input field, which value should be collected with a <div class="classProps">.

Another solution would be to use some more input fields for your youtube widget.

If your widget is not a P2BaseWidget phundament reads all public variables and renders simple text fields for them (limited length).

So you may use i.e. these public properties in your widget: youtubeId, width, height and generate the complete HTML within your widget.

Does this help?

Yep, I used the second approach (in previous posts there is a sample widget code) :)

(just not very convenient to copy-paste parts of generated code by Youtube).

So it should be modified later on :)

[edit]

OT: Is it possible that admin tool bar would be in top of flash, swf, and other video screen objects?

Best regards,

CoLT

Should be, I did it here: http://www.merida-bikes.com/de_de/

This is it ;) Where have you set this parameter?

Thanks!

CoLT

Either try raising the z-index in your menu CSS or maybe changing wmode=‘opaque’ in your flash-object tag.

[general-UI-I18N]

I noticed some strange behaviour with en_us message file @ Phundament.

It just ignores this file and its place holders to translate e.g.

USER_PROBLEMS’ => ‘Still problems?! Please contact us by or by our <a href="{contactUrl}">contact page</a> or by <a href=“mailto:{email}”>e-mail</a>.’,

or simple ‘rememberMe’ => ‘Remember me next time’,

Where the problem could be?

Greetings,

CoLT

You can change it in "modules/p2/extensions/langhandler/ELangHandler.php"

I set source language to some other language example


Yii::app()->sourceLanguage = 'man';

What is this mean? That my source code is written in man language. So it forced to look up other language like in phundament is en_us.

Greetings,

R.K.

Yeah, exactly.

I sometimes set, i.e. sourceLanguage to null, because I work with translation placeholders like "MyMessage" which then also can be translated to en_us.

Hi,

One issue regarding Phundament Cell management http://code.google.com/p/phundament/issues/detail?id=49

It could be more intuitive to manage Cells, e.g. when creating P2 with sample data, then adding more pages, html, and then removing unnecessary pages, html. Cells are not removed, therefore its hard to track down which one belongs where.

Eg. Request Param in certain cases are Page ID (name could be stated).

Eg. If its html widget, ID refers to HTML content (beginning could be stated)

In other words, Usability is most important to make this CMS up and going stable.

Greetings,

CoLT

Hi Colt,

thanks for your idea. Yeah, should be implemented :) sometime.

Best regards,

Tobias

PS: http://code.google.com/p/phundament/issues/detail?id=50